/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * com_distri_folios_detalle.java
 *
 * Created on 31/01/2011, 02:35:57 PM
 */

package sie_invdis;

/**
 *
 * @author Michelle
 */
import java.awt.print.PrinterException;
import java.sql.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.*;
import java.awt.*;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Calendar;
import java.text.*;
import javax.swing.table.DefaultTableCellRenderer;

import java.text.ParseException;

public class com_distri_folios_detalle extends javax.swing.JFrame {
    private javax.swing.table.DefaultTableModel jtable_modelo_detalle;
    private javax.swing.table.DefaultTableModel jtable_modelo_faltante;
    private javax.swing.table.DefaultTableModel jtable_modelo_sobrante;
    private javax.swing.table.DefaultTableModel jtable_modelo_etiquetas;
    private javax.swing.table.DefaultTableModel jtable_modelo_factura;
    private javax.swing.table.DefaultTableModel jtable_modelo_almacensur;
    private JTable jtable_tiendas=variables_global.gettabla_tiendas();
    private javax.swing.table.DefaultTableModel jtable_modelo_facturacompleta;
    private javax.swing.table.DefaultTableModel jtable_modelo_facturabloque;
    private SimpleDateFormat formateador = new SimpleDateFormat("dd-MM-yyyy");
    private SimpleDateFormat formateadoresta = new SimpleDateFormat("yyyy-MM-dd");
    private java.util.Date fechahoy=new Date();

    DefaultTableCellRenderer alinearCentro, alinearderecha, alinearIzquierda;

    bd_conexion x = new bd_conexion() ;
    ResultSet rs = null;
    private DefaultListModel modelo ;
    int columnavisualisa=1,yacarguerecaux=0,yacarguefot=0,controlcombo=0;
    String textohtmlf="",textohtml="";
    /** Creates new form com_distri_folios_detalle */
    public com_distri_folios_detalle() {
       initComponents();
     }
 public com_distri_folios_detalle(String dfolio) {
        this.iniciar_modelo_de_tabladetalle();
        this.iniciar_modelo_de_tablaetiquetas();
        this.iniciar_modelo_de_tablafactura();
        this.iniciar_modelo_de_faltante();
        this.iniciar_modelo_de_sobrante();
        this.iniciar_modelo_articulosasurtir();
        this.iniciar_modelo_tiendasfacturas();
        this.iniciar_modelo_de_tablafacturacompleto();
        this.iniciar_modelo_de_tablafacturabloque();
        initComponents();
        this.btn_guardar.setVisible(false);
        this.jbtn_fechallegatienda.setVisible(false);

        if(variables_global.getnivelusu()<3)
            {
                this.jbtn_cancelar.setVisible(true);
            }
        else
            {
                this.jbtn_cancelar.setVisible(false);
            }
        jt_foliosdetalle.getColumnModel().getColumn(0).setPreferredWidth(30);//cantidad
        jt_foliosdetalle.getColumnModel().getColumn(1).setPreferredWidth(70);//codigo
        jt_foliosdetalle.getColumnModel().getColumn(2).setPreferredWidth(190);//descripcion.
        jt_foliosdetalle.getColumnModel().getColumn(3).setPreferredWidth(70);//item
        jt_foliosdetalle.getColumnModel().getColumn(4).setPreferredWidth(30);//Precio
        jt_foliosdetalle.getColumnModel().getColumn(5).setPreferredWidth(10);//id
        jt_foliosdetalle.getColumnModel().getColumn(6).setPreferredWidth(45);//faltante
        jt_foliosdetalle.getColumnModel().getColumn(7).setPreferredWidth(45);//sobrante
        jt_foliosdetalle.getColumnModel().getColumn(8).setPreferredWidth(20);//sobrante
        jt_foliosdetalle.getColumnModel().getColumn(9).setPreferredWidth(20);//sobrante
        jt_foliosdetalle.getColumnModel().getColumn(10).setPreferredWidth(20);//sobrante

      this.carga_datos_encabezado(8,dfolio);
      this.carga_datos_clientes(2,   this.jtf_idc.getText());
      this.carga_datos_detalle(this.tf_foliotienda.getText());
        //jt_foliosdetalle.getTableHeader().setBackground(Color.yellow);
      jt_foliosdetalle.requestFocus();
      this.setLocation(10,10);
      //this.buttonGroup1.setSelected(jrbtn_columnaclave.getModel(), true);
      textohtmlf+="<tr><td></td><td></td><td></td><td></td><td></td><td>Subtotal:</td><td><font face=\"times new roman\" size=2>"+this.jtf_doctosubtotal.getText()+"</font></td></tr>";
      textohtmlf+="<tr><td></td><td></td><td></td><td></td><td></td><td>Descuento:</td><td><font face=\"times new roman\" size=2>"+this.jtf_doctodesc.getText()+"</font></td></tr>";
      textohtmlf+="<tr><td></td><td></td><td></td><td></td><td></td><td>Total:</td><td><font face=\"times new roman\" size=2>"+this.jtf_doctototal.getText()+"</font></td></tr></table>";
      this.jep_facturaexport.setText("<html><head></head><body>"+textohtmlf+"</body></html>");

        jt_sobrantes.getColumnModel().getColumn(0).setPreferredWidth(60);//id
        jt_sobrantes.getColumnModel().getColumn(1).setPreferredWidth(10);//faltante
        jt_sobrantes.getColumnModel().getColumn(2).setPreferredWidth(120);//sobrante
        jt_sobrantes.getColumnModel().getColumn(3).setPreferredWidth(10);//sobrante
        jt_sobrantes.getColumnModel().getColumn(4).setPreferredWidth(10);//sobrante
        jt_sobrantes.getColumnModel().getColumn(5).setPreferredWidth(15);//sobrante
        jt_sobrantes.getColumnModel().getColumn(6).setPreferredWidth(10);//sobrante
        jt_sobrantes.getColumnModel().getColumn(7).setPreferredWidth(10);//sobrante
        jt_sobrantes.getColumnModel().getColumn(8).setPreferredWidth(10);//sobrante

        jt_faltantes.getColumnModel().getColumn(0).setPreferredWidth(60);//id
        jt_faltantes.getColumnModel().getColumn(1).setPreferredWidth(10);//faltante
        jt_faltantes.getColumnModel().getColumn(2).setPreferredWidth(120);//sobrante
        jt_faltantes.getColumnModel().getColumn(3).setPreferredWidth(10);//sobrante
        jt_faltantes.getColumnModel().getColumn(4).setPreferredWidth(10);//sobrante
        jt_faltantes.getColumnModel().getColumn(5).setPreferredWidth(15);//sobrante
        jt_faltantes.getColumnModel().getColumn(6).setPreferredWidth(10);//sobrante
        jt_faltantes.getColumnModel().getColumn(7).setPreferredWidth(10);//sobrante
        jt_faltantes.getColumnModel().getColumn(8).setPreferredWidth(10);//sobrante
        this.jtf_ffecha.setText(this.fechaeuropea(fechahoy).replace("-", "/"));

        this.iniciar_modelo_tiendasexisc(this.jtf_idc.getText());
        controlcombo=1;
    }

 public com_distri_folios_detalle(String dfolio,String fcompra) {
        this.iniciar_modelo_de_tabladetalle();
        this.iniciar_modelo_de_tablaetiquetas();
        this.iniciar_modelo_de_tablafactura();
        this.iniciar_modelo_de_faltante();
        this.iniciar_modelo_de_sobrante();
        this.iniciar_modelo_articulosasurtir();
        this.iniciar_modelo_tiendasfacturas();
        this.iniciar_modelo_de_tablafacturacompleto();
        this.iniciar_modelo_de_tablafacturabloque();
        initComponents();
        this.btn_guardar.setVisible(false);
        this.jbtn_fechallegatienda.setVisible(false);
        jt_foliosdetalle.getColumnModel().getColumn(0).setPreferredWidth(20);//cantidad
        jt_foliosdetalle.getColumnModel().getColumn(1).setPreferredWidth(70);//codigo
        jt_foliosdetalle.getColumnModel().getColumn(2).setPreferredWidth(120);//descripcion.
        jt_foliosdetalle.getColumnModel().getColumn(3).setPreferredWidth(70);//item
        jt_foliosdetalle.getColumnModel().getColumn(4).setPreferredWidth(30);//Precio
        jt_foliosdetalle.getColumnModel().getColumn(5).setPreferredWidth(10);//id
        jt_foliosdetalle.getColumnModel().getColumn(6).setPreferredWidth(45);//faltante
        jt_foliosdetalle.getColumnModel().getColumn(7).setPreferredWidth(45);//sobrante
        jt_foliosdetalle.getColumnModel().getColumn(8).setPreferredWidth(20);//sobrante
        jt_foliosdetalle.getColumnModel().getColumn(9).setPreferredWidth(20);//sobrante
        jt_foliosdetalle.getColumnModel().getColumn(10).setPreferredWidth(20);//sobrante

      this.carga_datos_encabezado(11,dfolio);
      this.carga_datos_clientes(2,   this.jtf_idc.getText());
      this.carga_datos_detalle(this.tf_foliotienda.getText());
        //jt_foliosdetalle.getTableHeader().setBackground(Color.yellow);
      jt_foliosdetalle.requestFocus();
      this.setLocation(10,10);
     // this.buttonGroup1.setSelected(jrbtn_columnaclave.getModel(), true);
      textohtmlf+="<tr><td></td><td></td><td></td><td></td><td></td><td>Subtotal:</td><td><font face=\"times new roman\" size=2>"+this.jtf_doctosubtotal.getText()+"</font></td></tr>";
      textohtmlf+="<tr><td></td><td></td><td></td><td></td><td></td><td>Descuento:</td><td><font face=\"times new roman\" size=2>"+this.jtf_doctodesc.getText()+"</font></td></tr>";
      textohtmlf+="<tr><td></td><td></td><td></td><td></td><td></td><td>Total:</td><td><font face=\"times new roman\" size=2>"+this.jtf_doctototal.getText()+"</font></td></tr></table>";
      this.jep_facturaexport.setText("<html><head></head><body>"+textohtmlf+"</body></html>");

        jt_sobrantes.getColumnModel().getColumn(0).setPreferredWidth(60);//id
        jt_sobrantes.getColumnModel().getColumn(1).setPreferredWidth(10);//faltante
        jt_sobrantes.getColumnModel().getColumn(2).setPreferredWidth(120);//sobrante
        jt_sobrantes.getColumnModel().getColumn(3).setPreferredWidth(10);//sobrante
        jt_sobrantes.getColumnModel().getColumn(4).setPreferredWidth(10);//sobrante
        jt_sobrantes.getColumnModel().getColumn(5).setPreferredWidth(15);//sobrante
        jt_sobrantes.getColumnModel().getColumn(6).setPreferredWidth(10);//sobrante
        jt_sobrantes.getColumnModel().getColumn(7).setPreferredWidth(10);//sobrante
        jt_sobrantes.getColumnModel().getColumn(8).setPreferredWidth(10);//sobrante

        jt_faltantes.getColumnModel().getColumn(0).setPreferredWidth(60);//id
        jt_faltantes.getColumnModel().getColumn(1).setPreferredWidth(10);//faltante
        jt_faltantes.getColumnModel().getColumn(2).setPreferredWidth(120);//sobrante
        jt_faltantes.getColumnModel().getColumn(3).setPreferredWidth(10);//sobrante
        jt_faltantes.getColumnModel().getColumn(4).setPreferredWidth(10);//sobrante
        jt_faltantes.getColumnModel().getColumn(5).setPreferredWidth(15);//sobrante
        jt_faltantes.getColumnModel().getColumn(6).setPreferredWidth(10);//sobrante
        jt_faltantes.getColumnModel().getColumn(7).setPreferredWidth(10);//sobrante
        jt_faltantes.getColumnModel().getColumn(8).setPreferredWidth(10);//sobrante
        this.jtf_ffecha.setText(this.fechaeuropea(fechahoy).replace("-", "/"));
        this.iniciar_modelo_tiendasexisc(this.jtf_idc.getText());
        controlcombo=1;
    }


  private void iniciar_modelo_de_tabladetalle()
    {
        jtable_modelo_detalle=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_detalle.addColumn("<html><b>Cant.</b></html>");
        jtable_modelo_detalle.addColumn("<html><b>Clave</b></html>");
        jtable_modelo_detalle.addColumn("<html><b>Descripcion</b></html>");
        jtable_modelo_detalle.addColumn("<html><b>Item</b></html>");
        jtable_modelo_detalle.addColumn("<html><b>P. Publico</b></html>");
        jtable_modelo_detalle.addColumn("<html><b>Id</b></html>");
        jtable_modelo_detalle.addColumn("<html><b>Faltante</b></html>");
        jtable_modelo_detalle.addColumn("<html><b>Sobrante</b></html>");
        jtable_modelo_detalle.addColumn("<html><b>Precio</b></html>");
        jtable_modelo_detalle.addColumn("<html><b>%Desc.</b></html>");
        jtable_modelo_detalle.addColumn("<html><b>%Imp..</b></html>");
        jtable_modelo_detalle.addColumn("<html><b>Importe.</b></html>");
        jtable_modelo_detalle.addColumn("<html><b>Obser.</b></html>");

 }
  private void iniciar_modelo_de_tablaetiquetas()
    {
        jtable_modelo_etiquetas=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_etiquetas.addColumn("<html><b>Codigo</b></html>");
        jtable_modelo_etiquetas.addColumn("<html><b>Descripcion</b></html>");
        jtable_modelo_etiquetas.addColumn("<html><b>Precio</b></html>");
        jtable_modelo_etiquetas.addColumn("<html><b>Cant.</b></html>");
        jtable_modelo_etiquetas.addColumn("<html><b>Item</b></html>");
    }
    private void iniciar_modelo_de_tablafactura()
    {
        jtable_modelo_factura=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_factura.addColumn("<html><b>Cant.</b></html>");
        jtable_modelo_factura.addColumn("<html><b>Descripcion</b></html>");
        jtable_modelo_factura.addColumn("<html><b>Codigo</b></html>");
        jtable_modelo_factura.addColumn("<html><b>Costo</b></html>");
        jtable_modelo_factura.addColumn("<html><b>Item</b></html>");
    }
  private void iniciar_modelo_de_sobrante()
    {
        jtable_modelo_sobrante=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_sobrante.addColumn("<html><b>Codigo.</b></html>");
        jtable_modelo_sobrante.addColumn("<html><b>Cantidad</b></html>");
        jtable_modelo_sobrante.addColumn("<html><b>Nombre</b></html>");
        jtable_modelo_sobrante.addColumn("<html><b>P. Unitario</b></html>");
        jtable_modelo_sobrante.addColumn("<html><b>Desc.</b></html>");
        jtable_modelo_sobrante.addColumn("<html><b>Total.</b></html>");
        jtable_modelo_sobrante.addColumn("<html><b>Idc.</b></html>");
        jtable_modelo_sobrante.addColumn("<html><b>Idd.</b></html>");
        jtable_modelo_sobrante.addColumn("<html><b>tipo.</b></html>");
    }
    private void iniciar_modelo_de_faltante()
    {
        jtable_modelo_faltante=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_faltante.addColumn("<html><b>Codigo.</b></html>");
        jtable_modelo_faltante.addColumn("<htabla_articulos_exportartml><b>Cantidad</b></html>");
        jtable_modelo_faltante.addColumn("<html><b>Nombre</b></html>");
        jtable_modelo_faltante.addColumn("<html><b>P. Unitario</b></html>");
        jtable_modelo_faltante.addColumn("<html><b>Desc.</b></html>");
        jtable_modelo_faltante.addColumn("<html><b>Total.</b></html>");
        jtable_modelo_faltante.addColumn("<html><b>Idc.</b></html>");
        jtable_modelo_faltante.addColumn("<html><b>Idd.</b></html>");
        jtable_modelo_faltante.addColumn("<html><b>tipo.</b></html>");
    }
    private void iniciar_modelo_articulosasurtir()
{
      jtable_modelo_almacensur=new javax.swing.table.DefaultTableModel();//Creo el modelo
      jtable_modelo_almacensur.addColumn("Tienda");
      jtable_modelo_almacensur.addColumn("Almacen");
      jtable_modelo_almacensur.addColumn("Articulo");
      jtable_modelo_almacensur.addColumn("Descripcion");
      jtable_modelo_almacensur.addColumn("Cantidad");
      jtable_modelo_almacensur.addColumn("Observ.");
}
    public void centrar_datos()
    {
        alinearderecha = new DefaultTableCellRenderer();
        alinearderecha.setHorizontalAlignment(SwingConstants.RIGHT);

        jt_foliosdetalle.getColumnModel().getColumn(0).setCellRenderer(alinearderecha);
        jt_foliosdetalle.getColumnModel().getColumn(4).setCellRenderer(alinearderecha);
        jt_foliosdetalle.getColumnModel().getColumn(8).setCellRenderer(alinearderecha);
        jt_foliosdetalle.getColumnModel().getColumn(11).setCellRenderer(alinearderecha);

    }

private void iniciar_modelo_tiendasfacturas()
    {
        modelo = new javax.swing.DefaultListModel();
        try
            {
               rs = x.sieuno_executediversosv2("select * from x1distribucion_terminados_distribucion_clientes_activos() as (id smallint,idcleinte character varying(12),ordenvisua smallint,clientenombre character varying(60),orden smallint);",variables_global.getconexiongral());
               while (rs.next())
                    {
                          modelo.addElement(rs.getString("idcleinte")+":"+rs.getString("clientenombre"));
                    }
            }
            catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
    }

private void iniciar_modelo_tiendasexisc(String tienda)
    {
        String texto="select * from x1sieuno_articulo_inven_ubicacion(3,0,'"+tienda+"','','','') as (id smallint,des text);";
        System.out.println("ubicar"+texto);
        try
            {
              rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
               while (rs.next())
                    {
                        this.jcbx_tiendas.addItem(rs.getString("id")+":"+rs.getString("des"));
                    }



             }
            catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
    }

 private void iniciar_modelo_de_tablafacturacompleto()
    {
        jtable_modelo_facturacompleta=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_facturacompleta.addColumn("<html><b>Id Docto</b></html>");
        jtable_modelo_facturacompleta.addColumn("<html><b>Cant.</b></html>");
        jtable_modelo_facturacompleta.addColumn("<html><b>Descripcion</b></html>");
        jtable_modelo_facturacompleta.addColumn("<html><b>Codigo</b></html>");
        jtable_modelo_facturacompleta.addColumn("<html><b>Item</b></html>");
        jtable_modelo_facturacompleta.addColumn("<html><b>Costo</b></html>");
        jtable_modelo_facturacompleta.addColumn("<html><b>Importe</b></html>");
    }
  private void iniciar_modelo_de_tablafacturabloque()
    {
        jtable_modelo_facturabloque=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_facturabloque.addColumn("<html><b>Cant.</b></html>");
        jtable_modelo_facturabloque.addColumn("<html><b>Descripcion</b></html>");
        jtable_modelo_facturabloque.addColumn("<html><b>Codigo</b></html>");
        jtable_modelo_facturabloque.addColumn("<html><b>Item</b></html>");
        jtable_modelo_facturabloque.addColumn("<html><b>Costo</b></html>");
        jtable_modelo_facturabloque.addColumn("<html><b>%desc</b></html>");
        jtable_modelo_facturabloque.addColumn("<html><b>%I.V.A.</b></html>");
        jtable_modelo_facturabloque.addColumn("<html><b>Importe</b></html>");
    }
    private void carga_datos_encabezado(int opcion,String folio)
        {
          int statusdocumento=0;
      String texto="select * from x1distribucion_terminados_ventas_catalogov2('all',"+opcion+",'"+folio+"') as (idreg integer,id character varying(12),idesta smallint,desta character varying(15), claveperdoc character varying(45),dante character varying(12), doctosig character varying(12),fedoc text,feent text,fechavenci date,impuesto1 numeric,impuesto2 numeric,descuentotot numeric,descuentofin numeric,idcliente character varying(12),nomclie character varying(60),obserdoc character varying(80), usuario character varying(20),flete numeric,guia character varying(60), fechaenvio date,idmoneda smallint,descripmoneda character varying(30),idalmacen smallint,describamacen character varying(30),total numeric,tpz numeric,distra integer,clasif smallint,distrans2 integer)";
      System.out.println(texto);
        try
         {
            //rs = x.sieuno_executediversosv2("select * from x1distribucion_terminados_ventas_catalogov2('all',1,'"+dfolio+"') as (id character varying(12),idesta smallint,desta character varying(15), dante character varying(12), fedoc text,feent text,fechaven text,nomclie character varying(60),obserdoc character varying(80), guia character varying(60), tpz numeric,distra integer)",variables_global.getconexiongral());
            rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
            while (rs.next())
                {
                    statusdocumento=rs.getInt("idesta");

                    this.tf_fecha.setText(rs.getString("fedoc")+":"+this.DiaSemana(rs.getString("fedoc")));
                    this.tf_foliodistribucion.setText(rs.getString("dante"));
                    this.tf_foliosig.setText(rs.getString("doctosig"));
                    this.tf_foliotienda.setText(folio);
                    this.tf_status.setText(rs.getString("desta"));
                    this.jtf_idc.setText(rs.getString("idcliente"));
                    this.tf_cliente.setText(rs.getString("nomclie"));
                    this.ta_observaciones.setText(rs.getString("obserdoc"));
                    //this.tf_totalpiezas.setText(rs.getString("tpz"));
                    if((statusdocumento < 3) && (statusdocumento  > 0))
                            {
                                this.jtf_fecharecepcion.setText(rs.getString("feent")+":"+this.DiaSemana(rs.getString("feent")));
                            }
                     if(rs.getString("fedoc") != null)
                            {
                                this.jtf_fecharecibidotienda.setText(rs.getString("fedoc")+":"+this.DiaSemana(rs.getString("fedoc")));
                                this.btn_guardar.setVisible(true);
                            }
                     else
                            {
                                this.jbtn_fechallegatienda.setVisible(true);

                            }
                    if(statusdocumento == 5)
                        {
                        this.btn_guardar.setVisible(false);
                        }
                    this.jta_guiadocto.setText(rs.getString("guia"));
                    textohtmlf+="<table><tr>S.I. Michelle</tr><tr><td rowspan=4><img src=\"http://"+variables_global.getHost()+"/javaweb/imagenespuntoventa/logo.png\" width=\"180\" height=\"120\" border=\"0\" alt=\"Foto Articulo\"></img></td><td><font face=\"times new roman\" size=2>Fecha:"+rs.getString("fedoc")+"Folio Documento:"+folio+" Estatus:"+rs.getString("desta")+"</font></td></tr>";
                  
                }
        }
        catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
        //no muestro la opcion para guardar o Recepcionar
         if(statusdocumento < 3)
            {
                this.btn_guardar.setVisible(false);
            }
      System.out.println(textohtmlf);
        }


  private void carga_datos_clientes(int opcion,String textobusca)
    {
       Object[] fnewRow = new Object[9];
       String texto="select * from x1distribucion_terminados_ventas_clientes_catalogo("+opcion+",'"+textobusca+"','') as (id character varying(12),nombre character varying(60),direccion character varying(50),colonia character varying(50),poblacion character varying(40),cpcliente character varying(6),rfc character varying(15),curp character varying(20),telefono character varying(80),fax character varying(15),email character varying(80),clasif smallint,diascre smallint,limite numeric,descliente numeric,fechaultv date,fechaultp date,obser character varying(80),idstatus smallint,direccion2 character varying(80),statusdes character varying(40),descripcla character varying(40),atnven character varying(60),atncob character varying(60),acumcli numeric,idreg integer);";
       System.out.println(texto);
       try
       {
            rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
            while (rs.next())
                {
                       fnewRow[0]=rs.getString("idstatus")+":"+rs.getString("statusdes");
                       fnewRow[1]=rs.getString("clasif")+":"+rs.getString("descripcla");
                       this.jtf_domcalle.setText(rs.getString("direccion"));
                       this.jtf_domcolonia.setText(rs.getString("colonia"));
                       this.jtf_dompoblacion.setText(rs.getString("poblacion"));
                       this.jtf_telefono.setText(rs.getString("telefono"));
                       this.jtf_email.setText(rs.getString("email"));
                        /*
                               if (rs.getString("fechaultv")!= null)
                                {
                                    fnewRow[6]=this.fechaeuropea(rs.getString("fechaultv"));
                                }
                              * */
                        this.jtf_domcod.setText(rs.getString("cpcliente"));
                        this.jtf_direccion2.setText(rs.getString("direccion2"));
                        textohtmlf+="<tr><td><font face=\"times new roman\" size=2>Cliente:"+rs.getString("id")+":"+rs.getString("nombre")+"Direccion:"+rs.getString("direccion")+"</font></td></tr>";
                        textohtmlf+="<tr><td><font face=\"times new roman\" size=2>Colonia:"+rs.getString("colonia")+" "+rs.getString("poblacion")+"cp:"+rs.getString("cpcliente")+" Rfc:"+rs.getString("rfc")+"</font></td></tr>";
                        textohtmlf+="<tr><td><font face=\"times new roman\" size=2>Direccion Entrega:"+rs.getString("direccion2")+" Referencia:"+rs.getString("obser")+" tel/email:"+rs.getString("telefono")+"/"+rs.getString("email")+"</font></td></tr></table>";
                        this.setTitle("Recepciones Detalle Folio:"+rs.getString("id")+" Cliente"+rs.getString("nombre"));
                }
        }
        catch(Exception e)
            {
            System.out.println(e.getMessage());
            }
       System.out.println(textohtmlf);
   }


    private void carga_datos_detalle(String folio)
            {
      int id_incrementable=0;
      String falta="0", sobra="0";
      double costo=0,costoi=0;
      textohtml="<tr><th>Clave Articulo/Descripcion/foto</th><th>Clave Articulo/Descripcion/foto</th><th>Clave Articulo/Descripcion/foto</th><th>Clave Articulo/Descripcion/foto</th></tr>";
      int fila=0;
      DecimalFormat miformat = new DecimalFormat("############.####");
      textohtmlf+="<table><tr><td><font face=\"times new roman\" size=2>Cantidad</font></td><td><font face=\"times new roman\" size=2>codigo</font></td><td><font face=\"times new roman\" size=2>Descripcion</font></td><td><font face=\"times new roman\" size=2>Unidad</font></td><td><font face=\"times new roman\" size=2>Precio</font></td><td><font face=\"times new roman\" size=2>% Desc</font></td><td><font face=\"times new roman\" size=2>Importe</font></td></tr>";
        try
            {
            rs = x.sieuno_executediversosv2("select * from x1distribucion_terminados_ventas_detalle(2,'"+folio+"') as (idreg integer,iddocto character varying(12), ida character varying(16),cant_ar numeric, costoarticulo numeric,precioarti numeric,importe numeric,observ_p character varying(60),descr character varying(80),unidadsal character varying(3),describetipo character varying(40),ite character varying(20),precio_v numeric,desc1 numeric,desc2 numeric,impuesto1 numeric,dif_rep numeric,politicades smallint,tipocam numeric,idarticulosubmod character varying(4));",variables_global.getconexiongral());
            while (rs.next())
                {
                falta="0";
                sobra="0";
                if (variables_global.getnivelusu()<3)
                    {
                        costo=rs.getFloat("precio_v");
                        costoi=rs.getFloat("precioarti");
                    }
                else
                    {
                        costo=rs.getFloat("precio_v");
                        costoi=0;
                    }
                   //imprimimos todos los datos contenidos en la tabla
                    //Cantidad=rs.getString (4);
                    //Codigo=rs.getString (3);
                    //Descripcion=rs.getString (9);
                    //precio=rs.getString (14);
                    //id
                if (rs.getFloat("dif_rep") < 0)
                    {
                        falta=rs.getString ("dif_rep");
                        jtable_modelo_faltante.addRow(new Object[]{rs.getString ("ida"),rs.getFloat("dif_rep")*-1,rs.getString ("descr"),miformat.format(costo),"0",(rs.getFloat("dif_rep")*costo)*-1,"0","0","1"});
                        this.jtf_importefal.setText(String.valueOf(Float.valueOf(this.jtf_importefal.getText().toString()).floatValue()+((rs.getFloat("dif_rep")*costo)*-1)));
                    }
                if (rs.getFloat("dif_rep") > 0)
                    {
                       sobra=rs.getString ("dif_rep");
                       jtable_modelo_sobrante.addRow(new Object[]{rs.getString ("ida"),rs.getFloat("dif_rep"),rs.getString ("descr"),miformat.format(costo),"0",(rs.getFloat("dif_rep")*costo),"0","0","1"});
                       this.jtf_importesob.setText(String.valueOf(Float.valueOf(this.jtf_importesob.getText().toString()).floatValue()+(rs.getFloat("dif_rep")*costo)));
                    }
                 id_incrementable+=1;
                jtable_modelo_detalle.addRow(new Object[]{rs.getString ("cant_ar"),rs.getString ("ida"),rs.getString ("descr"),rs.getString ("ite"),miformat.format(costo),"<html><b>"+id_incrementable+"</b></html>",falta,sobra,miformat.format(costoi),rs.getString("desc1"),rs.getString ("impuesto1"),"",rs.getString ("observ_p")});
                textohtmlf+="<tr><td><font face=\"times new roman\" size=2>"+rs.getString ("cant_ar")+"</font></td><td><font face=\"times new roman\" size=2>"+rs.getString ("ida")+"</font></td><td><font face=\"times new roman\" size=2>"+rs.getString ("descr")+"</font></td><td><font face=\"times new roman\" size=2>"+rs.getString ("unidadsal")+"</font></td><td><font face=\"times new roman\" size=2>"+miformat.format(rs.getFloat("costoarticulo"))+"</font></td><td><font face=\"times new roman\" size=2>"+miformat.format(rs.getFloat("impuesto1"))+"</font></td><td><font face=\"times new roman\" size=2>"+miformat.format(rs.getFloat("importe"))+"</font></td>";
                if(rs.getString ("observ_p").length()>0)
                    {
                        textohtmlf+="</tr><tr><td><font face=\"times new roman\" size=2>"+rs.getString ("observ_p")+"</td>";
                    }
                textohtmlf+="</tr>";
                jtable_modelo_etiquetas.addRow(new Object[]{rs.getString ("ida"),rs.getString ("descr"),miformat.format(costo),rs.getString ("cant_ar"),rs.getString ("ite")});
                jtable_modelo_almacensur.addRow(new Object[]{"0","09",rs.getString ("ida"),rs.getString ("descr"),rs.getString ("cant_ar"),"."});
                if (variables_global.getnivelusu()<3)
                    {
                            jtable_modelo_factura.addRow(new Object[]{rs.getString ("cant_ar"),rs.getString ("descr"),rs.getString ("ida"),miformat.format(rs.getFloat("costoarticulo")),rs.getString ("ite")});
                    }
                         if ((variables_global.getnivelusu()<3) && (rs.getFloat("cant_ar")>0))
                            {
                                jtable_modelo_facturacompleta.addRow(new Object[]{folio,rs.getString ("cant_ar"),rs.getString ("descr"),rs.getString ("ida"),rs.getString ("ite"),miformat.format(rs.getFloat("costoarticulo")),miformat.format(rs.getFloat("costoarticulo")*rs.getFloat("cant_ar"))});
                            }
                }
        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }
        //this.jepn_fotos.setText("<html><head></head><body><table>"+textohtml+"</table></body></html>");
         System.out.println(textohtml);
        this.calcularimportes();
        this.paginas();
        this.carga_datos_facturapaginacion(0);
        this.centrar_datos();
      }

 private String DiaSemana(String fe) {
     //recibe un la fecha en strin formato dd-MM-yyyy
         String dia = "";
       java.util.Date fecha=null;
         try
           {
             fecha = formateador.parse(fe);
           }
        catch (ParseException e)
           {

            //Error, la cadena de texto no se puede convertir en fecha.
           }
        Calendar cal= Calendar.getInstance();
        cal.setTime(fecha);
        //ojo para establecer o recetear cada parte de la fecha por separado
        //cal.set(Calendar.YEAR, fecha.getYear());
        //cal.set(Calendar.MONTH, fecha.getMonth());
        //cal.set(Calendar.DAY_OF_MONTH, fecha.getDay());
        int diaInt = cal.get(Calendar.DAY_OF_WEEK);
        switch (diaInt) {
            case 1:
                dia = "Domingo";
                break;
            case 2:
                dia = "Lunes";
                break;
            case 3:
                dia = "Martes";
                break;
            case 4:
                dia = "Miercoles";
                break;
            case 5:
                dia = "Jueves";
                break;
            case 6:
                dia = "Viernes";
                break;
            case 7:
                dia = "Sabado";
                break;
        }
        return dia;
    }
 private String  fechaeuropea(Date fecha) {
       SimpleDateFormat formateadorestaeuropa = new SimpleDateFormat("dd-MM-yyyy");
       String cadenafecha="";

       cadenafecha= formateadorestaeuropa.format(fecha);
       return cadenafecha;
    }
 private String  fechaeuropea(String fecha) {
         //resibe cadena de fecha en formato americano yyyy-MM-dd
        java.util.Date fechaestaeuropa=null;
       SimpleDateFormat formateadorestaeuropa = new SimpleDateFormat("dd-MM-yyyy");
       String cadenafecha="";
        try
         {
          fechaestaeuropa = formateadoresta.parse(fecha);
         }
        catch (ParseException e)
          {
             //Error, la cadena de texto no se puede convertir en fecha.
          }
       cadenafecha= formateadorestaeuropa.format(fechaestaeuropa);
       return cadenafecha;
    }

 private void verfotosestereporte()
    {
     int numerofilas=this.jtable_modelo_detalle.getRowCount();
        this.cambiartamanofilas();
             for(int i = 0 ;i < numerofilas; i++)
                {
                      jtable_modelo_detalle.setValueAt("<html><head></head><body><p style=\"margin-top: 0\"><img src=\"http://"+variables_global.getHostfotos()+"/"+variables_global.getcarpetaaplicacion()+"/fotos/"+jtable_modelo_detalle.getValueAt(i, 1).toString()+".JPG\" width=\"90\" height=\"60\" border=\"0\" alt=\"Foto\"></img></p></body></html>", i,8);
                }
     
           //
    }
  private void quitarfotosestereporte()
    {
     int numerofilas=this.jtable_modelo_detalle.getRowCount();

             for(int i = 0 ;i < numerofilas; i++)
                {
                      jtable_modelo_detalle.setValueAt("", i,8);
                      jt_foliosdetalle.setRowHeight(i, 15);
                }
   
           //
    }
  private void find_textoenjtable(int columna,int filainicio,String texto)
    {
       int totalfilasreporte=this.jtable_modelo_detalle.getRowCount(),i=0,encontro=0,coincidencias=0;
       String cadenaobtenida="";
         //genero los totales por tienda
       for(i=0;i<totalfilasreporte;i++)
            {
                cadenaobtenida=jtable_modelo_detalle.getValueAt(i, columna).toString();
                encontro=cadenaobtenida.indexOf(texto);
                if(encontro!=-1)
                    {
                        System.out.println(cadenaobtenida+" en pocicion "+i);
                        this.jt_foliosdetalle.changeSelection(i, 0, true, false);
                        encontro=-1;
                        coincidencias++;
                    }
            }
 //           this.jlb_resultado.setText("Resultado:"+this.jtf_buscarenjtable.getText()+"="+coincidencias);
    }
private void calcularimportes()
    {
    DecimalFormat miformat = new DecimalFormat("############.##");
    int numerofilas=this.jtable_modelo_detalle.getRowCount(),error=0;
    String punto="",comas="",imagen="";
    float cantidad=0,costo=0,importefila=0,descuento=0,impuesto=0,doctosubtotal=0,doctoimpuesto=0,doctodescuento=0,doctototal=0,piezasindi=0,pzdif=0,pzdifc=0,pzdifa=0;
    for(int i = 0 ;i < numerofilas; i++)
        {
            try
                       {
                            pzdif = (Float.valueOf(this.jt_foliosdetalle.getValueAt(i, 6).toString().replace("-", ""))*-1)+(Float.valueOf(this.jt_foliosdetalle.getValueAt(i, 7).toString()).floatValue());
                            pzdifa+=pzdif;
                            System.out.println("pzindi:"+pzdif+" acumulado"+pzdifa);
                            cantidad = Float.valueOf(this.jt_foliosdetalle.getValueAt(i, 0).toString()).floatValue();
                            costo = Float.valueOf(this.jt_foliosdetalle.getValueAt(i, 8).toString()).floatValue();
                            pzdifc+=Float.valueOf(this.jt_foliosdetalle.getValueAt(i, 8).toString()).floatValue()*pzdif;
                            piezasindi+=cantidad;
                            
                            descuento=(costo*cantidad)*(Float.valueOf(this.jt_foliosdetalle.getValueAt(i, 9).toString())/100);
                            //System.out.println(descuento);
                            impuesto=Float.valueOf(this.jt_foliosdetalle.getValueAt(i, 10).toString())/100;
                            
                            importefila=(cantidad*costo);
                            doctodescuento+=descuento;
                            doctosubtotal+=importefila;
                        }
                            catch (NumberFormatException nfe) {
                            cantidad=0;
                            costo=0;
                            error=1;
                        }
                      jtable_modelo_detalle.setValueAt(miformat.format(importefila), i,11);
                }
    doctoimpuesto=(doctosubtotal-doctodescuento)*impuesto;
    doctototal=(doctosubtotal-doctodescuento)+doctoimpuesto;
    this.jtf_doctosubtotal.setText(miformat.format(doctosubtotal));
    this.jtf_doctodesc.setText(miformat.format(doctodescuento));
    this.jtf_doctoimp.setText(miformat.format(doctoimpuesto));
    this.jtf_doctototal.setText(miformat.format(doctototal));
    this.jtf_totalpiezas.setText(miformat.format(piezasindi));
  System.out.println("final     pzindi:"+pzdif+" acumulado"+pzdifa);
    this.jtf_totalpiezas1.setText(miformat.format(pzdifa));
    this.jtf_doctototal1.setText(miformat.format(pzdifc));
    }

 private void calcularimportesfactura()
    {
     DecimalFormat miformat = new DecimalFormat("###,###,###,###.##");
     DecimalFormat miformatim = new DecimalFormat("############.##");
     int numerofilas=this.jtable_modelo_facturabloque.getRowCount(),error=0;
    String punto="",comas="",imagen="";
    float cantidad=0,costo=0,importefila=0,descuento=0,impuesto=0,doctosubtotal=0,doctoimpuesto=0,doctodescuento=0,doctototal=0,piezasindi=0,doctoimpuestop=0;
    System.out.println("calculandoimporte"+numerofilas);
     for(int i = 0 ;i < numerofilas; i++)
                {
                 try
                       {

                            cantidad = Float.valueOf(this.jtable_modelo_facturabloque.getValueAt(i, 0).toString()).floatValue();
                            costo = Float.valueOf(this.jtable_modelo_facturabloque.getValueAt(i, 4).toString()).floatValue();

                            piezasindi+=cantidad;
                            descuento=(costo*cantidad)*(Float.valueOf(this.jtable_modelo_facturabloque.getValueAt(i, 5).toString())/100);
                            importefila=(cantidad*costo);

                            impuesto=(importefila-descuento)*Float.valueOf(this.jtable_modelo_facturabloque.getValueAt(i, 6).toString())/100;
                            //System.out.println(descuento+":"+impuesto);
                            doctodescuento+=descuento;
                            doctosubtotal+=importefila;
                            doctoimpuestop+=impuesto;

                        }
                            catch (NumberFormatException nfe) {
                            cantidad=0;
                            costo=0;
                            error=1;
                        }
                      jtable_modelo_facturabloque.setValueAt(miformatim.format(importefila),i,7);
                }
    //doctoimpuesto=(doctosubtotal-doctodescuento)*impuesto;
    doctototal=(doctosubtotal-doctodescuento)+doctoimpuestop;
    this.jtf_fsubtotal.setText(miformat.format(doctosubtotal));
    this.jtf_fdescuento.setText(miformat.format(doctodescuento));
    this.jtf_fImpuesto.setText(miformat.format(doctoimpuestop));
    this.jtf_ftotal.setText(miformat.format(doctototal));
    this.jtf_importepesos.setText(this.PesosMN(doctototal));
 
    
    }

private String find_esquema(String idcli)
{
       String esquema="";
            try
            {
               rs = x.sieuno_executediversosv2("select * from x1distribucion_tiendas_activas(6,'"+idcli+"','') as (tie_descri character varying(35),tie_id integer,tie_desesque text,idclie character varying(12));",variables_global.getconexiongral());
               while (rs.next())
                    {
                          esquema=rs.getString("tie_desesque");
                    }
            }
            catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
return esquema;
}

private String find_idtie(String idcli)
{
    int numerotiendas=this.jtable_tiendas.getRowCount(),ii=0;
    String idtienda="";
             for(ii=0;ii<numerotiendas;ii++)
                        {
                            if (idcli.equals(this.jtable_tiendas.getValueAt(ii,3).toString()))
                                {
                                    idtienda=this.jtable_tiendas.getValueAt(ii,1).toString();
                                }

                        }
return idtienda;
}
  private void carga_datos_recepcionaux(int opcion,String textobusca)
    {
       String texto="select * from x1distribucion_terminados_ventas_recep_aux("+opcion+",'"+textobusca+"','') as (id integer, iddocto character varying(12),hora time,idemplea integer,idfoliosob integer,idfoliofal integer,empnom character varying(50),emppat character varying(50),empmat character varying(50));";
       System.out.println(texto);
       try
       {
            rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
            while (rs.next())
                {
                       this.jtf_operorecepcion.setText(rs.getString("idemplea")+": "+rs.getString("empnom")+"  "+rs.getString("emppat")+"  "+rs.getString("empmat"));
                       this.jtf_operorechora.setText(rs.getString("hora").substring(0, 5));
                       this.jtf_operosobfol.setText(rs.getString("idfoliosob"));
                       this.jtf_operofalfol.setText(rs.getString("idfoliofal"));
                }
        }
        catch(Exception e)
            {
            System.out.println(e.getMessage());
            }
   }

private void carga_datos_clientesexterno(int opcion,String textobusca)
    {
       int encontrado=0;
       //x.estableceConexionexterna();
       String texto="select * from x1distribucion_terminados_ventas_clientes_catalogo("+opcion+",'"+textobusca+"','') as (id character varying(12),nombre character varying(60),direccion character varying(50),colonia character varying(50),poblacion character varying(40),cpcliente character varying(6),rfc character varying(15),curp character varying(20),telefono character varying(80),fax character varying(15),email character varying(80),clasif smallint,diascre smallint,limite numeric,descliente numeric,fechaultv date,fechaultp date,obser character varying(80),idstatus smallint,direccion2 character varying(80),statusdes character varying(40),descripcla character varying(40),atnven character varying(60),atncob character varying(60),acumcli numeric,idreg integer);";
       System.out.println(texto);
       try
       {
            rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongralext());
            while (rs.next())
                {
                       this.jtf_idclienteexterno.setText(rs.getString("id"));
                       this.jtf_clieteexterno.setText(rs.getString("nombre"));
                       encontrado=1;
                }
        }
        catch(Exception e)
            {
            System.out.println(e.getMessage());
            }
       if (encontrado==0)
              {
                this.guarda_clienteexterno(1);
              }
   int numeroarticulos=this.jtable_modelo_almacensur.getRowCount();
   for(int ii=0;ii<numeroarticulos;ii++)
                {
                           jtable_modelo_almacensur.setValueAt(this.jtf_idclienteexterno.getText(),ii ,0);
                }
   }
    private void guarda_clienteexterno(int opcion)
    {
       String texto="select * from x1distribucion_terminados_ventas_clientes_alta("+opcion+",'"+"0"+"','"+this.tf_cliente.getText().toString().toUpperCase().trim()+"','"+this.jtf_domcalle.getText().toString().toUpperCase().trim()+"','"+this.jtf_domcolonia.getText().toString().toUpperCase().trim()+"','"+this.jtf_dompoblacion.getText().toString().toUpperCase().trim()+"','"+this.jtf_domcod.getText().toString().toUpperCase().trim()+"','"+this.jtf_rfc.getText().toString().toUpperCase()+"','','"+this.jtf_telefono.getText().toString().toUpperCase()+"','','"+this.jtf_email.getText().toString().trim()+"','1','0','0','0','"+""+"','1','"+this.jtf_direccion2.getText().toString().toUpperCase()+"','"+""+"','"+""+"')";
       System.out.println(texto);
       int confirma=0;
        try
         {
            rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongralext());
            while (rs.next())
                {
                     confirma=rs.getInt(1);
                     this.jtf_idclienteexterno.setText(rs.getString(1));
                     this.jtf_clieteexterno.setText(this.tf_cliente.getText().toString().toUpperCase().trim());
                }
        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }
       if (confirma>0)
              {
                JOptionPane.showMessageDialog(null,"Gracias datos Actualizados Correctamente", "Sistema Integral Clientes",1);
              }
         else
              {
                JOptionPane.showMessageDialog(null,"Error Consulte con Su Administrador", "Sistema Integral Clientes",1);
              }
      }

    private void carga_datos_facturapaginacion(int pagina)
    {
         while(jtable_modelo_facturabloque.getRowCount()>0)jtable_modelo_facturabloque.removeRow(0);
        Object[] fnewRowdet = new Object[8];
        int nif=0,pag=pagina,nobjetotabla=this.jtable_modelo_facturacompleta.getRowCount(),nip=0,ni=0,fila=0,artxpag=Integer.valueOf(this.jtf_fotosartxpag.getText().toString());
        float totalpaginas=this.jtable_modelo_facturacompleta.getRowCount()/artxpag;
        
             nif=((pag+1)*artxpag);
             nip=((pag)*artxpag);
                        if (nif < nobjetotabla )
                            {
                                nobjetotabla=nif;
                            }
                    /*Impresion de los productos*/
                        for(ni=nip;ni<nobjetotabla;ni++)
                        {
                                fnewRowdet[0]=jtable_modelo_facturacompleta.getValueAt(ni, 1).toString();
                                fnewRowdet[1]=jtable_modelo_facturacompleta.getValueAt(ni, 2).toString();
                                fnewRowdet[2]=jtable_modelo_facturacompleta.getValueAt(ni, 3).toString();
                                fnewRowdet[3]=jtable_modelo_facturacompleta.getValueAt(ni, 4).toString();
                                fnewRowdet[4]=jtable_modelo_facturacompleta.getValueAt(ni, 5).toString();
                                fnewRowdet[5]=this.jtf_fdesc.getText();
                                fnewRowdet[6]=this.jtf_fpimpu.getText();
                                fnewRowdet[7]="0";
                                jtable_modelo_facturabloque.addRow(fnewRowdet);
                        }
      this.calcularimportesfactura();
    }

    private void carga_datos_fotospaginacion(int pagina)
    {
        textohtml="";
        int nif=0,pag=pagina,nobjetotabla=this.jtable_modelo_detalle.getRowCount(),nip=0,ni=0,fila=0,artxpag=Integer.valueOf(this.jtf_fotosartxpag1.getText().toString());
        float totalpaginas=this.jtable_modelo_detalle.getRowCount()/artxpag;

        this.jlbl_paginas2.setText("PAGINAS :"+totalpaginas);
             nif=((pag+1)*artxpag);
             nip=((pag)*artxpag);
                        if (nif < nobjetotabla )
                            {
                                nobjetotabla=nif;
                            }
                    System.out.println("filas x pagina"+artxpag+"tOTAL FILAS:"+this.jtable_modelo_detalle.getRowCount()+" PAGINA ACTUAL "+pagina+" filainicial "+ nip + " Fila Final"+ nobjetotabla);
                    /*Impresion de los productos*/
                        for(ni=nip;ni<nobjetotabla;ni++)
                        {
                            System.out.println(" fila Actual "+ ni );
                                if (fila<=0)
                                    {
                                    	textohtml+= "<tr>";
                                    }
                                    fila++;
                                    textohtml+="<th>"+jtable_modelo_detalle.getValueAt(ni, 1).toString()+"<br>"+jtable_modelo_detalle.getValueAt(ni, 2).toString() + " $"+jtable_modelo_detalle.getValueAt(ni, 4).toString()+ "<br>"+"<img src=\"http://"+variables_global.getHostfotos()+"/"+variables_global.getcarpetaaplicacion()+"/fotos/"+jtable_modelo_detalle.getValueAt(ni, 1).toString()+".JPG\" width=230 height=190 border=0 alt=\"Foto Articulo\" />"+"</th>";
                                 if (fila>=4)
                                    {
                                        textohtml+= "</tr>";
                                        fila=0;
                                    }
                        }
         this.jepn_fotos.setText("<html><head></head><body><table>"+textohtml+"</table></body></html>");
         System.out.println(" este es html "+ textohtml );
    }


private String PesosMN(float total)
{
float lyCantidad=0, lyCentavos=0,totalf=0;
int lnDigito=0, lnPrimerDigito=0, lnSegundoDigito=0, lnTercerDigito=0,lnNumeroBloques=0,lnBloqueCero=0,I=0;
String lcBloque="",lcbloquefinal="",pesosmn="",pesosmnfinal="",importetexto="",importepartido[]=null;
DecimalFormat miformat = new DecimalFormat("###,###,###,###");
DecimalFormat miformatint = new DecimalFormat("############.##");
importetexto=miformatint.format(total);
importetexto=importetexto.replace(".", ":");
importepartido=importetexto.split(":");
//lyCantidad =  (int) (Math.round(total));
lyCantidad=Integer.valueOf(importepartido[0]);
System.out.println("dividir Primero::"+lyCantidad+" ");
lyCentavos = (total-lyCantidad ) * 100;

String laUnidades[] = {"UN", "DOS", "TRES", "CUATRO", "CINCO", "SEIS", "SIETE", "OCHO", "NUEVE", "DIEZ", "ONCE", "DOCE", "TRECE", "CATORCE", "QUINCE", "DIECISEIS", "DIECISIETE", "DIECIOCHO", "DIECINUEVE", "VEINTE", "VEINTIUN", "VEINTIDOS", "VEINTITRES", "VEINTICUATRO", "VEINTICINCO", "VEINTISEIS", "VEINTISIETE", "VEINTIOCHO", "VEINTINUEVE"};
String laDecenas[] = {"DIEZ", "VEINTE", "TREINTA", "CUARENTA", "CINCUENTA", "SESENTA", "SETENTA", "OCHENTA", "NOVENTA"};
String laCentenas[] = {"CIENTO", "DOSCIENTOS", "TRESCIENTOS", "CUATROCIENTOS", "QUINIENTOS", "SEISCIENTOS", "SETECIENTOS", "OCHOCIENTOS", "NOVECIENTOS"};
lnNumeroBloques = 1;
do
{
    lnPrimerDigito = 0;
    lnSegundoDigito = 0;
    lnTercerDigito = 0;

    lcBloque = "";
    lnBloqueCero = 0;
    for(I=1;I<4;I++)
		{
			lnDigito =  (int) (lyCantidad % 10);
            System.out.println("mod Primero::"+lnDigito+" For"+I);
			if (lnDigito != 0)
				{
					switch(I)
					{
						case 1:
							lcBloque = " " + laUnidades[lnDigito - 1];
							lnPrimerDigito = lnDigito;
						break;
                        case 2:
							if(lnDigito <= 2){
                                    lcBloque = "  " + laUnidades[(lnDigito * 10) + lnPrimerDigito - 1];
								}
							else{
                                    lcbloquefinal=lcBloque;
                                    lcBloque = "  " + laDecenas[lnDigito - 1];
                                    if(lnPrimerDigito != 0){
                                        	lcBloque+=" Y";
                                        }
									 lcBloque+=lcbloquefinal;
								}
								lnSegundoDigito = lnDigito;
						break;
                        case 3:
								lcbloquefinal=lcBloque;
								lcBloque = " ";
								if((lnDigito == 1) && (lnPrimerDigito == 0) && (lnSegundoDigito == 0)){
										lcBloque+="CIEN";
									}
									lcBloque+=laCentenas[lnDigito - 1];
									lcBloque+=lcbloquefinal;
                                    lnTercerDigito = lnDigito;
						break;
					}
				}
			else{
					lnBloqueCero = lnBloqueCero + 1;
				}
//System.out.println("dividir antes::"+lyCantidad+" ");
		lyCantidad = (int)(lyCantidad / 10);
System.out.println("dividir despues::"+lyCantidad+" ");
		if(lyCantidad == 0){
            			I=3;
                        System.out.println("Fin del For:"+lyCantidad+" ");
                }
	}//fin del for
	switch(lnNumeroBloques)
	{
		case 1:
			pesosmn = lcBloque;
		break;
		case 2:
			pesosmnfinal=pesosmn;
			pesosmn = lcBloque;
				if(lnBloqueCero == 3)
					{}
				else{
					pesosmn+=" MIL";
				}
				pesosmn+=pesosmnfinal;
		break;
		case 3:
			pesosmnfinal=pesosmn;
			pesosmn = lcBloque;
			if((lnPrimerDigito == 1) && (lnSegundoDigito == 0) && (lnTercerDigito == 0))
				{
				pesosmn+=" MILLON";
				}
			else
				{
				pesosmn+=" MILLONES";
				}
			pesosmn+=pesosmnfinal;
		break;
	}
    System.out.println("bloque:"+lcBloque+" ");
	lnNumeroBloques = lnNumeroBloques + 1;
}
while(lyCantidad != 0);
pesosmn="" + pesosmn;
if( total > 1)
{
	pesosmn+=" PESOS ";
}
else
{
	pesosmn+=" PESO ";
}
pesosmn+=miformat.format(lyCentavos) + "/100 M.N.";
return pesosmn;
}


    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        jPanel2 = new javax.swing.JPanel();
        jbtn_helpayudame = new javax.swing.JButton();
        jbtn_salir = new javax.swing.JButton();
        btn_imprimir = new javax.swing.JButton();
        btn_guardar = new javax.swing.JButton();
        jbtn_fechallegatienda = new javax.swing.JButton();
        jbtn_cancelar = new javax.swing.JButton();
        jPanel3 = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        ta_observaciones = new javax.swing.JTextArea();
        jLabel6 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        tf_cliente = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        tf_status = new javax.swing.JTextField();
        tf_foliotienda = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        tf_foliodistribucion = new javax.swing.JTextField();
        jLabel1 = new javax.swing.JLabel();
        tf_fecha = new javax.swing.JTextField();
        jLabel8 = new javax.swing.JLabel();
        jtf_fecharecibidotienda = new javax.swing.JTextField();
        jLabel9 = new javax.swing.JLabel();
        jtf_fecharecepcion = new javax.swing.JTextField();
        jLabel10 = new javax.swing.JLabel();
        jScrollPane3 = new javax.swing.JScrollPane();
        jta_guiadocto = new javax.swing.JTextArea();
        jLabel16 = new javax.swing.JLabel();
        jtf_domcalle = new javax.swing.JTextField();
        jLabel17 = new javax.swing.JLabel();
        jtf_domcolonia = new javax.swing.JTextField();
        jLabel20 = new javax.swing.JLabel();
        jtf_domcod = new javax.swing.JTextField();
        jLabel23 = new javax.swing.JLabel();
        jtf_telefono = new javax.swing.JTextField();
        jLabel21 = new javax.swing.JLabel();
        jtf_direccion2 = new javax.swing.JTextField();
        jLabel11 = new javax.swing.JLabel();
        jtf_descuento = new javax.swing.JTextField();
        jLabel12 = new javax.swing.JLabel();
        jtf_impuesto = new javax.swing.JTextField();
        jtf_idc = new javax.swing.JTextField();
        jLabel34 = new javax.swing.JLabel();
        jtf_rfc = new javax.swing.JTextField();
        jLabel36 = new javax.swing.JLabel();
        jtf_dompoblacion = new javax.swing.JTextField();
        jtf_email = new javax.swing.JTextField();
        jLabel37 = new javax.swing.JLabel();
        jLabel38 = new javax.swing.JLabel();
        tf_foliosig = new javax.swing.JTextField();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel4 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jt_foliosdetalle = new javax.swing.JTable(){
            public boolean isCellEditable(int rowIndex, int mColIndex) {
                if ((mColIndex < 6) || (mColIndex>7))
                return false;
                else
                return true;
            }
        }
        ;
        jLabel18 = new javax.swing.JLabel();
        jtf_totalpiezas = new javax.swing.JTextField();
        jLabel19 = new javax.swing.JLabel();
        jtf_doctosubtotal = new javax.swing.JTextField();
        jLabel22 = new javax.swing.JLabel();
        jtf_doctodesc = new javax.swing.JTextField();
        jLabel24 = new javax.swing.JLabel();
        jtf_doctoimp = new javax.swing.JTextField();
        jLabel25 = new javax.swing.JLabel();
        jtf_doctototal = new javax.swing.JTextField();
        jtf_etiquetasfallidas = new javax.swing.JTextField();
        jLabel32 = new javax.swing.JLabel();
        jLabel33 = new javax.swing.JLabel();
        jtf_etiquetasfaltante = new javax.swing.JTextField();
        jLabel58 = new javax.swing.JLabel();
        jtf_totalpiezas1 = new javax.swing.JTextField();
        jtf_doctototal1 = new javax.swing.JTextField();
        jcbx_tiendas = new javax.swing.JComboBox();
        jLabel13 = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        jScrollPane4 = new javax.swing.JScrollPane();
        jt_foliosdetalle1 = new javax.swing.JTable(){
            public boolean isCellEditable(int rowIndex, int mColIndex) {
                if (mColIndex < 6)
                return false;
                else
                return true;
            }
        }
        ;
        jPanel5 = new javax.swing.JPanel();
        jScrollPane5 = new javax.swing.JScrollPane();
        jt_formatofactura = new javax.swing.JTable(){
            public boolean isCellEditable(int rowIndex, int mColIndex) {
                if (mColIndex < 6)
                return false;
                else
                return true;
            }
        }
        ;
        jPanel6 = new javax.swing.JPanel();
        jLabel15 = new javax.swing.JLabel();
        jtf_observ_update = new javax.swing.JTextField();
        jbtn_actualizarobser = new javax.swing.JButton();
        jPanel9 = new javax.swing.JPanel();
        jScrollPane9 = new javax.swing.JScrollPane();
        jt_faltantes = new javax.swing.JTable(){
            public boolean isCellEditable(int rowIndex, int mColIndex) {
                if (mColIndex < 6)
                return false;
                else
                return true;
            }
        }
        ;
        jLabel27 = new javax.swing.JLabel();
        jtf_importefal = new javax.swing.JTextField();
        jLabel31 = new javax.swing.JLabel();
        jtf_operofalfol = new javax.swing.JTextField();
        jcb_verfotos2 = new javax.swing.JCheckBox();
        jPanel10 = new javax.swing.JPanel();
        jScrollPane8 = new javax.swing.JScrollPane();
        jt_sobrantes = new javax.swing.JTable(){
            public boolean isCellEditable(int rowIndex, int mColIndex) {
                if (mColIndex < 6)
                return false;
                else
                return true;
            }
        }
        ;
        jLabel26 = new javax.swing.JLabel();
        jtf_importesob = new javax.swing.JTextField();
        jLabel30 = new javax.swing.JLabel();
        jtf_operosobfol = new javax.swing.JTextField();
        jcb_verfotos1 = new javax.swing.JCheckBox();
        jLabel28 = new javax.swing.JLabel();
        jtf_operorecepcion = new javax.swing.JTextField();
        jLabel29 = new javax.swing.JLabel();
        jtf_operorechora = new javax.swing.JTextField();
        jbtn_actualizarobser1 = new javax.swing.JButton();
        jbtn_generarventa2 = new javax.swing.JButton();
        jPanel7 = new javax.swing.JPanel();
        jScrollPane6 = new javax.swing.JScrollPane();
        jepn_fotos = new javax.swing.JEditorPane();
        jtf_fotosartxpag1 = new javax.swing.JTextField();
        jlbl_paginas2 = new javax.swing.JLabel();
        jbtn_anterior1 = new javax.swing.JButton();
        jtf_paginaactual1 = new javax.swing.JTextField();
        jbtn_siguiente1 = new javax.swing.JButton();
        jPanel8 = new javax.swing.JPanel();
        jScrollPane7 = new javax.swing.JScrollPane();
        jep_facturaexport = new javax.swing.JEditorPane();
        jbtn_imprimirpedido = new javax.swing.JButton();
        jPanel11 = new javax.swing.JPanel();
        jPanel12 = new javax.swing.JPanel();
        jScrollPane10 = new javax.swing.JScrollPane();
        jtb_almacensurtirexterno = new javax.swing.JTable()
        {
            public boolean isCellEditable(int rowIndex, int mColIndex) {
                if (mColIndex < 2)
                return false;
                else
                return true;

            }
        }
        ;
        jbtn_guardaexterna = new javax.swing.JButton();
        jLabel35 = new javax.swing.JLabel();
        jtf_idclienteexterno = new javax.swing.JTextField();
        jtf_clieteexterno = new javax.swing.JTextField();
        jPanel13 = new javax.swing.JPanel();
        jScrollPane11 = new javax.swing.JScrollPane();
        jlst_clientesdistribucion = new javax.swing.JList();
        jPanel14 = new javax.swing.JPanel();
        jtf_cliente = new javax.swing.JTextField();
        jLabel39 = new javax.swing.JLabel();
        jtf_observaciones1 = new javax.swing.JTextField();
        jtf_idcliente1 = new javax.swing.JTextField();
        jLabel40 = new javax.swing.JLabel();
        jtf_dompobla1 = new javax.swing.JTextField();
        jtf_cp = new javax.swing.JTextField();
        jtf_domcalle1 = new javax.swing.JTextField();
        jLabel41 = new javax.swing.JLabel();
        jLabel42 = new javax.swing.JLabel();
        jLabel43 = new javax.swing.JLabel();
        jLabel44 = new javax.swing.JLabel();
        jtf_domcolonia1 = new javax.swing.JTextField();
        jLabel45 = new javax.swing.JLabel();
        jtf_email2 = new javax.swing.JTextField();
        jtf_direccion3 = new javax.swing.JTextField();
        jLabel46 = new javax.swing.JLabel();
        jtf_rfc1 = new javax.swing.JTextField();
        jLabel47 = new javax.swing.JLabel();
        jtf_tel = new javax.swing.JTextField();
        jLabel48 = new javax.swing.JLabel();
        jLabel49 = new javax.swing.JLabel();
        jtf_atnventas = new javax.swing.JTextField();
        jLabel50 = new javax.swing.JLabel();
        jtf_atncobra = new javax.swing.JTextField();
        jtf_ffecha = new javax.swing.JTextField();
        jScrollPane12 = new javax.swing.JScrollPane();
        jt_formatofactura1 = new javax.swing.JTable(){
            public boolean isCellEditable(int rowIndex, int mColIndex) {
                if (mColIndex < 6)
                return false;
                else
                return true;
            }
        }
        ;
        jScrollPane13 = new javax.swing.JScrollPane();
        jt_formatofactura2 = new javax.swing.JTable(){
            public boolean isCellEditable(int rowIndex, int mColIndex) {
                if (mColIndex < 6)
                return false;
                else
                return true;
            }
        }
        ;
        jtf_fsubtotal = new javax.swing.JTextField();
        jtf_fImpuesto = new javax.swing.JTextField();
        jtf_ftotal = new javax.swing.JTextField();
        jLabel51 = new javax.swing.JLabel();
        jLabel52 = new javax.swing.JLabel();
        jLabel53 = new javax.swing.JLabel();
        jtf_fpimpu = new javax.swing.JTextField();
        jLabel54 = new javax.swing.JLabel();
        jtf_fotosartxpag = new javax.swing.JTextField();
        jlbl_paginas = new javax.swing.JLabel();
        jbtn_anterior = new javax.swing.JButton();
        jtf_paginaactual = new javax.swing.JTextField();
        jbtn_siguiente = new javax.swing.JButton();
        jlbl_paginas1 = new javax.swing.JLabel();
        jtf_fdesc = new javax.swing.JTextField();
        jLabel55 = new javax.swing.JLabel();
        jLabel56 = new javax.swing.JLabel();
        jtf_fdescuento = new javax.swing.JTextField();
        btn_imprimir1 = new javax.swing.JButton();
        jtf_importepesos = new javax.swing.JTextField();
        jtf_fmargen = new javax.swing.JTextField();
        jLabel57 = new javax.swing.JLabel();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jMenuItem2 = new javax.swing.JMenuItem();
        jMenuItem5 = new javax.swing.JMenuItem();
        jMenuItem4 = new javax.swing.JMenuItem();
        jmni_guardarf7 = new javax.swing.JMenuItem();
        jMenuItem1 = new javax.swing.JMenuItem();
        jMenuItem7 = new javax.swing.JMenuItem();
        jmni_salir = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        jMenuItem6 = new javax.swing.JMenuItem();
        jmni_irabusqueda = new javax.swing.JMenuItem();
        jmni_impresioncosto = new javax.swing.JMenuItem();
        jMenu3 = new javax.swing.JMenu();
        jMenuItem3 = new javax.swing.JMenuItem();
        jmni_creasugerencia = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(sie_invdis.Sie_invdisApp.class).getContext().getResourceMap(com_distri_folios_detalle.class);
        setTitle(resourceMap.getString("Form.title")); // NOI18N
        setName("Form"); // NOI18N

        jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel2.setName("jPanel2"); // NOI18N

        jbtn_helpayudame.setIcon(resourceMap.getIcon("jbtn_helpayudame.icon")); // NOI18N
        jbtn_helpayudame.setText(resourceMap.getString("jbtn_helpayudame.text")); // NOI18N
        jbtn_helpayudame.setName("jbtn_helpayudame"); // NOI18N
        jbtn_helpayudame.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_helpayudameActionPerformed(evt);
            }
        });

        jbtn_salir.setIcon(resourceMap.getIcon("jbtn_salir.icon")); // NOI18N
        jbtn_salir.setText(resourceMap.getString("jbtn_salir.text")); // NOI18N
        jbtn_salir.setName("jbtn_salir"); // NOI18N
        jbtn_salir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_salirActionPerformed(evt);
            }
        });

        btn_imprimir.setIcon(resourceMap.getIcon("btn_imprimir.icon")); // NOI18N
        btn_imprimir.setText(resourceMap.getString("btn_imprimir.text")); // NOI18N
        btn_imprimir.setName("btn_imprimir"); // NOI18N
        btn_imprimir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_imprimirActionPerformed(evt);
            }
        });

        btn_guardar.setIcon(resourceMap.getIcon("btn_guardar.icon")); // NOI18N
        btn_guardar.setText(resourceMap.getString("btn_guardar.text")); // NOI18N
        btn_guardar.setName("btn_guardar"); // NOI18N
        btn_guardar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_guardarActionPerformed(evt);
            }
        });

        jbtn_fechallegatienda.setText(resourceMap.getString("jbtn_fechallegatienda.text")); // NOI18N
        jbtn_fechallegatienda.setToolTipText(resourceMap.getString("jbtn_fechallegatienda.toolTipText")); // NOI18N
        jbtn_fechallegatienda.setName("jbtn_fechallegatienda"); // NOI18N
        jbtn_fechallegatienda.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_fechallegatiendaActionPerformed(evt);
            }
        });

        jbtn_cancelar.setIcon(resourceMap.getIcon("jbtn_cancelar.icon")); // NOI18N
        jbtn_cancelar.setText(resourceMap.getString("jbtn_cancelar.text")); // NOI18N
        jbtn_cancelar.setName("jbtn_cancelar"); // NOI18N
        jbtn_cancelar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_cancelarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(btn_guardar)
                .addGap(43, 43, 43)
                .addComponent(jbtn_cancelar)
                .addGap(40, 40, 40)
                .addComponent(jbtn_fechallegatienda)
                .addGap(18, 18, 18)
                .addComponent(btn_imprimir)
                .addGap(42, 42, 42)
                .addComponent(jbtn_salir)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 75, Short.MAX_VALUE)
                .addComponent(jbtn_helpayudame)
                .addGap(20, 20, 20))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(btn_guardar)
                .addComponent(jbtn_fechallegatienda)
                .addComponent(btn_imprimir)
                .addComponent(jbtn_salir)
                .addComponent(jbtn_helpayudame)
                .addComponent(jbtn_cancelar))
        );

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel3.border.title"))); // NOI18N
        jPanel3.setName("jPanel3"); // NOI18N

        jScrollPane2.setName("jScrollPane2"); // NOI18N

        ta_observaciones.setColumns(20);
        ta_observaciones.setRows(5);
        ta_observaciones.setName("ta_observaciones"); // NOI18N
        jScrollPane2.setViewportView(ta_observaciones);

        jLabel6.setText(resourceMap.getString("jLabel6.text")); // NOI18N
        jLabel6.setName("jLabel6"); // NOI18N

        jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N
        jLabel5.setName("jLabel5"); // NOI18N

        tf_cliente.setEditable(false);
        tf_cliente.setFont(resourceMap.getFont("tf_cliente.font")); // NOI18N
        tf_cliente.setText(resourceMap.getString("tf_cliente.text")); // NOI18N
        tf_cliente.setName("tf_cliente"); // NOI18N
        tf_cliente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tf_clienteActionPerformed(evt);
            }
        });

        jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N
        jLabel4.setName("jLabel4"); // NOI18N

        tf_status.setEditable(false);
        tf_status.setFont(resourceMap.getFont("tf_status.font")); // NOI18N
        tf_status.setText(resourceMap.getString("tf_status.text")); // NOI18N
        tf_status.setName("tf_status"); // NOI18N

        tf_foliotienda.setEditable(false);
        tf_foliotienda.setFont(resourceMap.getFont("tf_foliotienda.font")); // NOI18N
        tf_foliotienda.setText(resourceMap.getString("tf_foliotienda.text")); // NOI18N
        tf_foliotienda.setName("tf_foliotienda"); // NOI18N
        tf_foliotienda.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tf_foliotiendaActionPerformed(evt);
            }
        });

        jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
        jLabel3.setName("jLabel3"); // NOI18N

        jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
        jLabel2.setName("jLabel2"); // NOI18N

        tf_foliodistribucion.setEditable(false);
        tf_foliodistribucion.setFont(resourceMap.getFont("tf_foliodistribucion.font")); // NOI18N
        tf_foliodistribucion.setText(resourceMap.getString("tf_foliodistribucion.text")); // NOI18N
        tf_foliodistribucion.setName("tf_foliodistribucion"); // NOI18N

        jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
        jLabel1.setName("jLabel1"); // NOI18N

        tf_fecha.setEditable(false);
        tf_fecha.setFont(resourceMap.getFont("tf_fecha.font")); // NOI18N
        tf_fecha.setName("tf_fecha"); // NOI18N
        tf_fecha.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tf_fechaActionPerformed(evt);
            }
        });

        jLabel8.setText(resourceMap.getString("jLabel8.text")); // NOI18N
        jLabel8.setName("jLabel8"); // NOI18N

        jtf_fecharecibidotienda.setEditable(false);
        jtf_fecharecibidotienda.setFont(resourceMap.getFont("jtf_fecharecibidotienda.font")); // NOI18N
        jtf_fecharecibidotienda.setText(resourceMap.getString("jtf_fecharecibidotienda.text")); // NOI18N
        jtf_fecharecibidotienda.setName("jtf_fecharecibidotienda"); // NOI18N

        jLabel9.setText(resourceMap.getString("jLabel9.text")); // NOI18N
        jLabel9.setName("jLabel9"); // NOI18N

        jtf_fecharecepcion.setEditable(false);
        jtf_fecharecepcion.setFont(resourceMap.getFont("jtf_fecharecepcion.font")); // NOI18N
        jtf_fecharecepcion.setText(resourceMap.getString("jtf_fecharecepcion.text")); // NOI18N
        jtf_fecharecepcion.setName("jtf_fecharecepcion"); // NOI18N

        jLabel10.setText(resourceMap.getString("jLabel10.text")); // NOI18N
        jLabel10.setName("jLabel10"); // NOI18N

        jScrollPane3.setName("jScrollPane3"); // NOI18N

        jta_guiadocto.setColumns(20);
        jta_guiadocto.setRows(5);
        jta_guiadocto.setName("jta_guiadocto"); // NOI18N
        jScrollPane3.setViewportView(jta_guiadocto);

        jLabel16.setText(resourceMap.getString("jLabel16.text")); // NOI18N
        jLabel16.setName("jLabel16"); // NOI18N

        jtf_domcalle.setEditable(false);
        jtf_domcalle.setName("jtf_domcalle"); // NOI18N
        jtf_domcalle.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtf_domcalleActionPerformed(evt);
            }
        });

        jLabel17.setText(resourceMap.getString("jLabel17.text")); // NOI18N
        jLabel17.setName("jLabel17"); // NOI18N

        jtf_domcolonia.setEditable(false);
        jtf_domcolonia.setName("jtf_domcolonia"); // NOI18N
        jtf_domcolonia.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtf_domcoloniaActionPerformed(evt);
            }
        });

        jLabel20.setText(resourceMap.getString("jLabel20.text")); // NOI18N
        jLabel20.setName("jLabel20"); // NOI18N

        jtf_domcod.setEditable(false);
        jtf_domcod.setName("jtf_domcod"); // NOI18N
        jtf_domcod.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtf_domcodActionPerformed(evt);
            }
        });

        jLabel23.setText(resourceMap.getString("jLabel23.text")); // NOI18N
        jLabel23.setName("jLabel23"); // NOI18N

        jtf_telefono.setEditable(false);
        jtf_telefono.setName("jtf_telefono"); // NOI18N
        jtf_telefono.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtf_telefonoActionPerformed(evt);
            }
        });

        jLabel21.setText(resourceMap.getString("jLabel21.text")); // NOI18N
        jLabel21.setName("jLabel21"); // NOI18N

        jtf_direccion2.setEditable(false);
        jtf_direccion2.setName("jtf_direccion2"); // NOI18N
        jtf_direccion2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtf_direccion2ActionPerformed(evt);
            }
        });

        jLabel11.setText(resourceMap.getString("jLabel11.text")); // NOI18N
        jLabel11.setName("jLabel11"); // NOI18N

        jtf_descuento.setEditable(false);
        jtf_descuento.setText(resourceMap.getString("jtf_descuento.text")); // NOI18N
        jtf_descuento.setName("jtf_descuento"); // NOI18N

        jLabel12.setText(resourceMap.getString("jLabel12.text")); // NOI18N
        jLabel12.setName("jLabel12"); // NOI18N

        jtf_impuesto.setEditable(false);
        jtf_impuesto.setText(resourceMap.getString("jtf_impuesto.text")); // NOI18N
        jtf_impuesto.setName("jtf_impuesto"); // NOI18N

        jtf_idc.setEditable(false);
        jtf_idc.setText(resourceMap.getString("jtf_idc.text")); // NOI18N
        jtf_idc.setName("jtf_idc"); // NOI18N

        jLabel34.setText(resourceMap.getString("jLabel34.text")); // NOI18N
        jLabel34.setName("jLabel34"); // NOI18N

        jtf_rfc.setEditable(false);
        jtf_rfc.setFont(resourceMap.getFont("jtf_rfc.font")); // NOI18N
        jtf_rfc.setName("jtf_rfc"); // NOI18N
        jtf_rfc.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtf_rfcActionPerformed(evt);
            }
        });

        jLabel36.setText(resourceMap.getString("jLabel36.text")); // NOI18N
        jLabel36.setName("jLabel36"); // NOI18N

        jtf_dompoblacion.setEditable(false);
        jtf_dompoblacion.setName("jtf_dompoblacion"); // NOI18N
        jtf_dompoblacion.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtf_dompoblacionActionPerformed(evt);
            }
        });

        jtf_email.setEditable(false);
        jtf_email.setName("jtf_email"); // NOI18N
        jtf_email.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtf_emailActionPerformed(evt);
            }
        });

        jLabel37.setText(resourceMap.getString("jLabel37.text")); // NOI18N
        jLabel37.setName("jLabel37"); // NOI18N

        jLabel38.setText(resourceMap.getString("jLabel38.text")); // NOI18N
        jLabel38.setName("jLabel38"); // NOI18N

        tf_foliosig.setEditable(false);
        tf_foliosig.setFont(resourceMap.getFont("tf_foliosig.font")); // NOI18N
        tf_foliosig.setName("tf_foliosig"); // NOI18N
        tf_foliosig.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tf_foliosigActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addComponent(jLabel16)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jtf_domcalle, javax.swing.GroupLayout.PREFERRED_SIZE, 255, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addComponent(jLabel20)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jtf_domcod, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel23)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jtf_telefono, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel37)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addComponent(jLabel17)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jtf_domcolonia, javax.swing.GroupLayout.PREFERRED_SIZE, 169, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addComponent(jtf_email, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jLabel21)))
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addGap(1, 1, 1)
                                .addComponent(jLabel36)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jtf_dompoblacion, javax.swing.GroupLayout.PREFERRED_SIZE, 169, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jtf_direccion2, javax.swing.GroupLayout.PREFERRED_SIZE, 241, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(74, 74, 74)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addGap(442, 442, 442)
                                .addComponent(jLabel11)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jtf_descuento, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jLabel12)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jtf_impuesto, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                                .addComponent(jLabel34)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jtf_rfc, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(68, 68, 68))))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel8)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtf_fecharecibidotienda, javax.swing.GroupLayout.PREFERRED_SIZE, 135, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel9)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtf_fecharecepcion, javax.swing.GroupLayout.PREFERRED_SIZE, 163, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel38)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(tf_foliosig, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel10)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 209, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jLabel6)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(47, 47, 47))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(tf_fecha, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(tf_foliodistribucion, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(tf_foliotienda, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel4)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(tf_status, javax.swing.GroupLayout.PREFERRED_SIZE, 118, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel5)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtf_idc, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(tf_cliente, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(tf_cliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(tf_fecha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel2)
                    .addComponent(tf_foliodistribucion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(tf_foliotienda, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel4)
                    .addComponent(tf_status, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel5)
                    .addComponent(jtf_idc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel16)
                            .addComponent(jtf_domcalle, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel11)
                            .addComponent(jtf_descuento, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel12)
                            .addComponent(jtf_impuesto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel20)
                            .addComponent(jtf_domcod, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jtf_telefono, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel23)
                            .addComponent(jLabel37)
                            .addComponent(jLabel34)
                            .addComponent(jtf_rfc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jtf_email, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel21)
                            .addComponent(jtf_direccion2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel17)
                            .addComponent(jtf_domcolonia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel36)
                            .addComponent(jtf_dompoblacion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(31, 31, 31)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addComponent(jScrollPane2, 0, 0, Short.MAX_VALUE)
                        .addComponent(jLabel6)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel8)
                            .addComponent(jtf_fecharecibidotienda, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel9)
                            .addComponent(jtf_fecharecepcion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel38)
                            .addComponent(tf_foliosig, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 27, Short.MAX_VALUE)
                        .addComponent(jLabel10)))
                .addContainerGap())
        );

        jTabbedPane1.setName("jTabbedPane1"); // NOI18N
        jTabbedPane1.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jTabbedPane1StateChanged(evt);
            }
        });

        jPanel4.setName("jPanel4"); // NOI18N

        jScrollPane1.setName("jScrollPane1"); // NOI18N

        jt_foliosdetalle.setModel(this.jtable_modelo_detalle);
        jt_foliosdetalle.setName("jt_foliosdetalle"); // NOI18N
        jt_foliosdetalle.setRowHeight(22);
        // TODO add your handling code here:

        jt_foliosdetalle.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {

                dioclick(evt);
                //System.out.println(" double click" );

            }
        });
        jt_foliosdetalle.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                jt_foliosdetalleKeyPressed(evt);
            }
        });
        jScrollPane1.setViewportView(jt_foliosdetalle);

        jLabel18.setText(resourceMap.getString("jLabel18.text")); // NOI18N
        jLabel18.setName("jLabel18"); // NOI18N

        jtf_totalpiezas.setEditable(false);
        jtf_totalpiezas.setText(resourceMap.getString("jtf_totalpiezas.text")); // NOI18N
        jtf_totalpiezas.setName("jtf_totalpiezas"); // NOI18N

        jLabel19.setText(resourceMap.getString("jLabel19.text")); // NOI18N
        jLabel19.setName("jLabel19"); // NOI18N

        jtf_doctosubtotal.setEditable(false);
        jtf_doctosubtotal.setName("jtf_doctosubtotal"); // NOI18N

        jLabel22.setText(resourceMap.getString("jLabel22.text")); // NOI18N
        jLabel22.setName("jLabel22"); // NOI18N

        jtf_doctodesc.setEditable(false);
        jtf_doctodesc.setName("jtf_doctodesc"); // NOI18N

        jLabel24.setText(resourceMap.getString("jLabel24.text")); // NOI18N
        jLabel24.setName("jLabel24"); // NOI18N

        jtf_doctoimp.setEditable(false);
        jtf_doctoimp.setName("jtf_doctoimp"); // NOI18N

        jLabel25.setText(resourceMap.getString("jLabel25.text")); // NOI18N
        jLabel25.setName("jLabel25"); // NOI18N

        jtf_doctototal.setEditable(false);
        jtf_doctototal.setName("jtf_doctototal"); // NOI18N

        jtf_etiquetasfallidas.setText(resourceMap.getString("jtf_etiquetasfallidas.text")); // NOI18N
        jtf_etiquetasfallidas.setToolTipText(resourceMap.getString("jtf_etiquetasfallidas.toolTipText")); // NOI18N
        jtf_etiquetasfallidas.setName("jtf_etiquetasfallidas"); // NOI18N

        jLabel32.setText(resourceMap.getString("jLabel32.text")); // NOI18N
        jLabel32.setName("jLabel32"); // NOI18N

        jLabel33.setText(resourceMap.getString("jLabel33.text")); // NOI18N
        jLabel33.setName("jLabel33"); // NOI18N

        jtf_etiquetasfaltante.setText(resourceMap.getString("jtf_etiquetasfaltante.text")); // NOI18N
        jtf_etiquetasfaltante.setToolTipText(resourceMap.getString("jtf_etiquetasfaltante.toolTipText")); // NOI18N
        jtf_etiquetasfaltante.setName("jtf_etiquetasfaltante"); // NOI18N

        jLabel58.setText(resourceMap.getString("jLabel58.text")); // NOI18N
        jLabel58.setName("jLabel58"); // NOI18N

        jtf_totalpiezas1.setEditable(false);
        jtf_totalpiezas1.setText(resourceMap.getString("jtf_totalpiezas1.text")); // NOI18N
        jtf_totalpiezas1.setName("jtf_totalpiezas1"); // NOI18N

        jtf_doctototal1.setEditable(false);
        jtf_doctototal1.setName("jtf_doctototal1"); // NOI18N

        jcbx_tiendas.setToolTipText(resourceMap.getString("jcbx_tiendas.toolTipText")); // NOI18N
        jcbx_tiendas.setName("jcbx_tiendas"); // NOI18N
        jcbx_tiendas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jcbx_tiendasActionPerformed(evt);
            }
        });

        jLabel13.setText(resourceMap.getString("jLabel13.text")); // NOI18N
        jLabel13.setName("jLabel13"); // NOI18N

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(jLabel18)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtf_totalpiezas, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel19)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtf_doctosubtotal, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel22)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtf_doctodesc, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel24)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtf_doctoimp, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel25)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGap(4, 4, 4)
                        .addComponent(jLabel58)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtf_totalpiezas1, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 70, Short.MAX_VALUE)
                        .addComponent(jtf_doctototal1, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(289, 289, 289)))
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(jLabel13)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jcbx_tiendas, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(jtf_doctototal, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel32)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtf_etiquetasfallidas, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel33)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jtf_etiquetasfaltante, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 927, Short.MAX_VALUE)
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 356, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 4, Short.MAX_VALUE)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jtf_totalpiezas1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel58)
                            .addComponent(jtf_doctototal1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jcbx_tiendas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel13))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jtf_totalpiezas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel18)
                    .addComponent(jLabel19)
                    .addComponent(jtf_doctosubtotal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel22)
                    .addComponent(jtf_doctodesc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel24)
                    .addComponent(jtf_doctoimp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel25)
                    .addComponent(jtf_doctototal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel32)
                    .addComponent(jtf_etiquetasfallidas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel33)
                    .addComponent(jtf_etiquetasfaltante, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        jTabbedPane1.addTab(resourceMap.getString("jPanel4.TabConstraints.tabTitle"), jPanel4); // NOI18N

        jPanel1.setName("jPanel1"); // NOI18N

        jScrollPane4.setName("jScrollPane4"); // NOI18N

        jt_foliosdetalle1.setModel(this.jtable_modelo_etiquetas);
        jt_foliosdetalle1.setName("jt_foliosdetalle1"); // NOI18N
        // TODO add your handling code here:

        jt_foliosdetalle.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {

                dioclick(evt);
                //System.out.println(" double click" );

            }
        });
        jt_foliosdetalle.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                jt_foliosdetalleKeyPressed(evt);
            }
        });
        jScrollPane4.setViewportView(jt_foliosdetalle1);

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 917, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 401, Short.MAX_VALUE)
                .addContainerGap())
        );

        jTabbedPane1.addTab(resourceMap.getString("jPanel1.TabConstraints.tabTitle"), jPanel1); // NOI18N

        jPanel5.setName("jPanel5"); // NOI18N

        jScrollPane5.setName("jScrollPane5"); // NOI18N

        jt_formatofactura.setModel(this.jtable_modelo_factura);
        jt_formatofactura.setName("jt_formatofactura"); // NOI18N
        // TODO add your handling code here:

        jt_foliosdetalle.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {

                dioclick(evt);
                //System.out.println(" double click" );

            }
        });
        jt_foliosdetalle.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                jt_foliosdetalleKeyPressed(evt);
            }
        });
        jScrollPane5.setViewportView(jt_formatofactura);

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 927, Short.MAX_VALUE)
            .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel5Layout.createSequentialGroup()
                    .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 917, Short.MAX_VALUE)
                    .addContainerGap()))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 423, Short.MAX_VALUE)
            .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel5Layout.createSequentialGroup()
                    .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 412, Short.MAX_VALUE)
                    .addContainerGap()))
        );

        jTabbedPane1.addTab(resourceMap.getString("jPanel5.TabConstraints.tabTitle"), jPanel5); // NOI18N

        jPanel6.setName("jPanel6"); // NOI18N

        jLabel15.setText(resourceMap.getString("jLabel15.text")); // NOI18N
        jLabel15.setName("jLabel15"); // NOI18N

        jtf_observ_update.setName("jtf_observ_update"); // NOI18N
        jtf_observ_update.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtf_observ_updateActionPerformed(evt);
            }
        });

        jbtn_actualizarobser.setIcon(resourceMap.getIcon("jbtn_actualizarobser.icon")); // NOI18N
        jbtn_actualizarobser.setText(resourceMap.getString("jbtn_actualizarobser.text")); // NOI18N
        jbtn_actualizarobser.setName("jbtn_actualizarobser"); // NOI18N
        jbtn_actualizarobser.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_actualizarobserActionPerformed(evt);
            }
        });

        jPanel9.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel9.border.title"))); // NOI18N
        jPanel9.setName("jPanel9"); // NOI18N

        jScrollPane9.setName("jScrollPane9"); // NOI18N

        jt_faltantes.setModel(this.jtable_modelo_faltante);
        jt_faltantes.setName("jt_faltantes"); // NOI18N
        // TODO add your handling code here:

        jt_foliosdetalle.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {

                dioclick(evt);
                //System.out.println(" double click" );

            }
        });
        jt_foliosdetalle.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                jt_foliosdetalleKeyPressed(evt);
            }
        });
        jScrollPane9.setViewportView(jt_faltantes);

        jLabel27.setText(resourceMap.getString("jLabel27.text")); // NOI18N
        jLabel27.setName("jLabel27"); // NOI18N

        jtf_importefal.setEditable(false);
        jtf_importefal.setText(resourceMap.getString("jtf_importefal.text")); // NOI18N
        jtf_importefal.setName("jtf_importefal"); // NOI18N

        jLabel31.setText(resourceMap.getString("jLabel31.text")); // NOI18N
        jLabel31.setName("jLabel31"); // NOI18N

        jtf_operofalfol.setEditable(false);
        jtf_operofalfol.setText(resourceMap.getString("jtf_operofalfol.text")); // NOI18N
        jtf_operofalfol.setName("jtf_operofalfol"); // NOI18N
        jtf_operofalfol.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtf_operofalfolActionPerformed(evt);
            }
        });

        jcb_verfotos2.setText(resourceMap.getString("jcb_verfotos2.text")); // NOI18N
        jcb_verfotos2.setToolTipText(resourceMap.getString("jcb_verfotos2.toolTipText")); // NOI18N
        jcb_verfotos2.setName("jcb_verfotos2"); // NOI18N
        jcb_verfotos2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jcb_verfotos2ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
        jPanel9.setLayout(jPanel9Layout);
        jPanel9Layout.setHorizontalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel27)
                .addGap(18, 18, 18)
                .addComponent(jtf_importefal, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel31)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jtf_operofalfol, javax.swing.GroupLayout.DEFAULT_SIZE, 45, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jcb_verfotos2))
            .addComponent(jScrollPane9, javax.swing.GroupLayout.DEFAULT_SIZE, 370, Short.MAX_VALUE)
        );
        jPanel9Layout.setVerticalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addComponent(jScrollPane9, javax.swing.GroupLayout.PREFERRED_SIZE, 159, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jtf_importefal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel31)
                    .addComponent(jtf_operofalfol, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel27)
                    .addComponent(jcb_verfotos2))
                .addContainerGap(92, Short.MAX_VALUE))
        );

        jPanel10.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel10.border.title"))); // NOI18N
        jPanel10.setName("jPanel10"); // NOI18N

        jScrollPane8.setName("jScrollPane8"); // NOI18N

        jt_sobrantes.setModel(this.jtable_modelo_sobrante);
        jt_sobrantes.setName("jt_sobrantes"); // NOI18N
        // TODO add your handling code here:

        jt_foliosdetalle.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {

                dioclick(evt);
                //System.out.println(" double click" );

            }
        });
        jt_foliosdetalle.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                jt_foliosdetalleKeyPressed(evt);
            }
        });
        jScrollPane8.setViewportView(jt_sobrantes);

        jLabel26.setText(resourceMap.getString("jLabel26.text")); // NOI18N
        jLabel26.setName("jLabel26"); // NOI18N

        jtf_importesob.setEditable(false);
        jtf_importesob.setText(resourceMap.getString("jtf_importesob.text")); // NOI18N
        jtf_importesob.setName("jtf_importesob"); // NOI18N

        jLabel30.setText(resourceMap.getString("jLabel30.text")); // NOI18N
        jLabel30.setName("jLabel30"); // NOI18N

        jtf_operosobfol.setEditable(false);
        jtf_operosobfol.setText(resourceMap.getString("jtf_operosobfol.text")); // NOI18N
        jtf_operosobfol.setName("jtf_operosobfol"); // NOI18N
        jtf_operosobfol.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtf_operosobfolActionPerformed(evt);
            }
        });

        jcb_verfotos1.setText(resourceMap.getString("jcb_verfotos1.text")); // NOI18N
        jcb_verfotos1.setToolTipText(resourceMap.getString("jcb_verfotos1.toolTipText")); // NOI18N
        jcb_verfotos1.setName("jcb_verfotos1"); // NOI18N
        jcb_verfotos1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jcb_verfotos1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
        jPanel10.setLayout(jPanel10Layout);
        jPanel10Layout.setHorizontalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel10Layout.createSequentialGroup()
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jScrollPane8, javax.swing.GroupLayout.Alignment.LEADING, 0, 0, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel10Layout.createSequentialGroup()
                        .addComponent(jLabel26)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtf_importesob, javax.swing.GroupLayout.PREFERRED_SIZE, 94, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel30)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtf_operosobfol, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jcb_verfotos1)))
                .addGap(54, 54, 54))
        );
        jPanel10Layout.setVerticalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel10Layout.createSequentialGroup()
                .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel26)
                    .addComponent(jtf_importesob, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel30)
                    .addComponent(jtf_operosobfol, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jcb_verfotos1))
                .addContainerGap(99, Short.MAX_VALUE))
        );

        jLabel28.setText(resourceMap.getString("jLabel28.text")); // NOI18N
        jLabel28.setName("jLabel28"); // NOI18N

        jtf_operorecepcion.setEditable(false);
        jtf_operorecepcion.setName("jtf_operorecepcion"); // NOI18N
        jtf_operorecepcion.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtf_operorecepcionActionPerformed(evt);
            }
        });

        jLabel29.setText(resourceMap.getString("jLabel29.text")); // NOI18N
        jLabel29.setName("jLabel29"); // NOI18N

        jtf_operorechora.setEditable(false);
        jtf_operorechora.setName("jtf_operorechora"); // NOI18N
        jtf_operorechora.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtf_operorechoraActionPerformed(evt);
            }
        });

        jbtn_actualizarobser1.setText(resourceMap.getString("jbtn_actualizarobser1.text")); // NOI18N
        jbtn_actualizarobser1.setName("jbtn_actualizarobser1"); // NOI18N
        jbtn_actualizarobser1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_actualizarobser1ActionPerformed(evt);
            }
        });

        jbtn_generarventa2.setText(resourceMap.getString("jbtn_generarventa2.text")); // NOI18N
        jbtn_generarventa2.setName("jbtn_generarventa2"); // NOI18N
        jbtn_generarventa2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_generarventa2ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup()
                        .addComponent(jPanel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(27, 27, 27))
                    .addGroup(jPanel6Layout.createSequentialGroup()
                        .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel6Layout.createSequentialGroup()
                                .addComponent(jLabel15)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jtf_observ_update, javax.swing.GroupLayout.PREFERRED_SIZE, 559, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel6Layout.createSequentialGroup()
                                .addComponent(jLabel28)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jtf_operorecepcion, javax.swing.GroupLayout.PREFERRED_SIZE, 223, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel29)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jtf_operorechora, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jbtn_generarventa2)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jbtn_actualizarobser1)
                            .addComponent(jbtn_actualizarobser))))
                .addContainerGap())
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel15)
                    .addComponent(jtf_observ_update, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jbtn_actualizarobser))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel28)
                    .addComponent(jtf_operorecepcion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel29)
                    .addComponent(jtf_operorechora, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jbtn_actualizarobser1)
                    .addComponent(jbtn_generarventa2))
                .addGap(23, 23, 23)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(13, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab(resourceMap.getString("jPanel6.TabConstraints.tabTitle"), jPanel6); // NOI18N

        jPanel7.setName("jPanel7"); // NOI18N

        jScrollPane6.setName("jScrollPane6"); // NOI18N

        jepn_fotos.setContentType(resourceMap.getString("jepn_fotos.contentType")); // NOI18N
        jepn_fotos.setName("jepn_fotos"); // NOI18N
        jScrollPane6.setViewportView(jepn_fotos);

        jtf_fotosartxpag1.setText(resourceMap.getString("jtf_fotosartxpag1.text")); // NOI18N
        jtf_fotosartxpag1.setToolTipText(resourceMap.getString("jtf_fotosartxpag1.toolTipText")); // NOI18N
        jtf_fotosartxpag1.setName("jtf_fotosartxpag1"); // NOI18N
        jtf_fotosartxpag1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtf_fotosartxpag1ActionPerformed(evt);
            }
        });

        jlbl_paginas2.setText(resourceMap.getString("jlbl_paginas2.text")); // NOI18N
        jlbl_paginas2.setName("jlbl_paginas2"); // NOI18N

        jbtn_anterior1.setIcon(resourceMap.getIcon("jbtn_anterior1.icon")); // NOI18N
        jbtn_anterior1.setText(resourceMap.getString("jbtn_anterior1.text")); // NOI18N
        jbtn_anterior1.setName("jbtn_anterior1"); // NOI18N
        jbtn_anterior1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_anterior1ActionPerformed(evt);
            }
        });

        jtf_paginaactual1.setText(resourceMap.getString("jtf_paginaactual1.text")); // NOI18N
        jtf_paginaactual1.setName("jtf_paginaactual1"); // NOI18N
        jtf_paginaactual1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtf_paginaactual1ActionPerformed(evt);
            }
        });

        jbtn_siguiente1.setIcon(resourceMap.getIcon("jbtn_siguiente1.icon")); // NOI18N
        jbtn_siguiente1.setText(resourceMap.getString("jbtn_siguiente1.text")); // NOI18N
        jbtn_siguiente1.setName("jbtn_siguiente1"); // NOI18N
        jbtn_siguiente1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_siguiente1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGap(198, 198, 198)
                        .addComponent(jtf_fotosartxpag1, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(50, 50, 50)
                        .addComponent(jlbl_paginas2)
                        .addGap(27, 27, 27)
                        .addComponent(jbtn_anterior1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jtf_paginaactual1, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jbtn_siguiente1))
                    .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 917, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel7Layout.createSequentialGroup()
                .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 392, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jlbl_paginas2)
                    .addComponent(jbtn_anterior1)
                    .addComponent(jbtn_siguiente1)
                    .addComponent(jtf_paginaactual1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jtf_fotosartxpag1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
        );

        jTabbedPane1.addTab(resourceMap.getString("jPanel7.TabConstraints.tabTitle"), jPanel7); // NOI18N

        jPanel8.setName("jPanel8"); // NOI18N

        jScrollPane7.setName("jScrollPane7"); // NOI18N

        jep_facturaexport.setContentType(resourceMap.getString("jep_facturaexport.contentType")); // NOI18N
        jep_facturaexport.setFont(resourceMap.getFont("jep_facturaexport.font")); // NOI18N
        jep_facturaexport.setName("jep_facturaexport"); // NOI18N
        jScrollPane7.setViewportView(jep_facturaexport);

        jbtn_imprimirpedido.setIcon(resourceMap.getIcon("jbtn_imprimirpedido.icon")); // NOI18N
        jbtn_imprimirpedido.setText(resourceMap.getString("jbtn_imprimirpedido.text")); // NOI18N
        jbtn_imprimirpedido.setName("jbtn_imprimirpedido"); // NOI18N
        jbtn_imprimirpedido.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_imprimirpedidoActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 760, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 67, Short.MAX_VALUE)
                .addComponent(jbtn_imprimirpedido, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane7, javax.swing.GroupLayout.DEFAULT_SIZE, 412, Short.MAX_VALUE)
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addGap(84, 84, 84)
                        .addComponent(jbtn_imprimirpedido, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );

        jTabbedPane1.addTab(resourceMap.getString("jPanel8.TabConstraints.tabTitle"), jPanel8); // NOI18N

        jPanel11.setName("jPanel11"); // NOI18N

        jPanel12.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel12.border.title"))); // NOI18N
        jPanel12.setName("jPanel12"); // NOI18N

        jScrollPane10.setName("jScrollPane10"); // NOI18N

        jtb_almacensurtirexterno.setModel(this.jtable_modelo_almacensur);
        jtb_almacensurtirexterno.setName("jtb_almacensurtirexterno"); // NOI18N
        jScrollPane10.setViewportView(jtb_almacensurtirexterno);

        jbtn_guardaexterna.setIcon(resourceMap.getIcon("jbtn_guardaexterna.icon")); // NOI18N
        jbtn_guardaexterna.setText(resourceMap.getString("jbtn_guardaexterna.text")); // NOI18N
        jbtn_guardaexterna.setName("jbtn_guardaexterna"); // NOI18N
        jbtn_guardaexterna.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_guardaexternaActionPerformed(evt);
            }
        });

        jLabel35.setText(resourceMap.getString("jLabel35.text")); // NOI18N
        jLabel35.setName("jLabel35"); // NOI18N

        jtf_idclienteexterno.setText(resourceMap.getString("jtf_idclienteexterno.text")); // NOI18N
        jtf_idclienteexterno.setName("jtf_idclienteexterno"); // NOI18N

        jtf_clieteexterno.setText(resourceMap.getString("jtf_clieteexterno.text")); // NOI18N
        jtf_clieteexterno.setName("jtf_clieteexterno"); // NOI18N

        javax.swing.GroupLayout jPanel12Layout = new javax.swing.GroupLayout(jPanel12);
        jPanel12.setLayout(jPanel12Layout);
        jPanel12Layout.setHorizontalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel12Layout.createSequentialGroup()
                .addContainerGap(401, Short.MAX_VALUE)
                .addComponent(jbtn_guardaexterna, javax.swing.GroupLayout.PREFERRED_SIZE, 147, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(64, 64, 64))
            .addGroup(jPanel12Layout.createSequentialGroup()
                .addComponent(jLabel35)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jtf_idclienteexterno, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jtf_clieteexterno, javax.swing.GroupLayout.PREFERRED_SIZE, 356, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
            .addComponent(jScrollPane10, javax.swing.GroupLayout.DEFAULT_SIZE, 612, Short.MAX_VALUE)
        );
        jPanel12Layout.setVerticalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel12Layout.createSequentialGroup()
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel35)
                    .addComponent(jtf_idclienteexterno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jtf_clieteexterno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane10, javax.swing.GroupLayout.PREFERRED_SIZE, 181, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 49, Short.MAX_VALUE)
                .addComponent(jbtn_guardaexterna))
        );

        javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
        jPanel11.setLayout(jPanel11Layout);
        jPanel11Layout.setHorizontalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(289, Short.MAX_VALUE))
        );
        jPanel11Layout.setVerticalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(101, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab(resourceMap.getString("jPanel11.TabConstraints.tabTitle"), jPanel11); // NOI18N

        jPanel13.setName("jPanel13"); // NOI18N

        jScrollPane11.setName("jScrollPane11"); // NOI18N

        jlst_clientesdistribucion.setModel(this.modelo);
        jlst_clientesdistribucion.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        jlst_clientesdistribucion.setName("jlst_clientesdistribucion"); // NOI18N
        jlst_clientesdistribucion.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jlst_clientesdistribucionMouseClicked(evt);
                if(evt.getClickCount() >= 1)
                {
                    dioclickfactura(evt);
                }
            }
        });
        jScrollPane11.setViewportView(jlst_clientesdistribucion);

        jPanel14.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel14.border.title"))); // NOI18N
        jPanel14.setName("jPanel14"); // NOI18N

        jtf_cliente.setName("jtf_cliente"); // NOI18N
        jtf_cliente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtf_clienteActionPerformed(evt);
            }
        });

        jLabel39.setText(resourceMap.getString("jLabel39.text")); // NOI18N
        jLabel39.setName("jLabel39"); // NOI18N

        jtf_observaciones1.setName("jtf_observaciones1"); // NOI18N
        jtf_observaciones1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtf_observaciones1ActionPerformed(evt);
            }
        });

        jtf_idcliente1.setEditable(false);
        jtf_idcliente1.setText(resourceMap.getString("jtf_idcliente1.text")); // NOI18N
        jtf_idcliente1.setAutoscrolls(false);
        jtf_idcliente1.setName("jtf_idcliente1"); // NOI18N

        jLabel40.setText(resourceMap.getString("jLabel40.text")); // NOI18N
        jLabel40.setName("jLabel40"); // NOI18N

        jtf_dompobla1.setName("jtf_dompobla1"); // NOI18N
        jtf_dompobla1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtf_dompobla1ActionPerformed(evt);
            }
        });

        jtf_cp.setName("jtf_cp"); // NOI18N
        jtf_cp.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtf_cpActionPerformed(evt);
            }
        });

        jtf_domcalle1.setName("jtf_domcalle1"); // NOI18N
        jtf_domcalle1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtf_domcalle1ActionPerformed(evt);
            }
        });

        jLabel41.setText(resourceMap.getString("jLabel41.text")); // NOI18N
        jLabel41.setName("jLabel41"); // NOI18N

        jLabel42.setText(resourceMap.getString("jLabel42.text")); // NOI18N
        jLabel42.setName("jLabel42"); // NOI18N

        jLabel43.setText(resourceMap.getString("jLabel43.text")); // NOI18N
        jLabel43.setName("jLabel43"); // NOI18N

        jLabel44.setText(resourceMap.getString("jLabel44.text")); // NOI18N
        jLabel44.setName("jLabel44"); // NOI18N

        jtf_domcolonia1.setName("jtf_domcolonia1"); // NOI18N
        jtf_domcolonia1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtf_domcolonia1ActionPerformed(evt);
            }
        });

        jLabel45.setText(resourceMap.getString("jLabel45.text")); // NOI18N
        jLabel45.setName("jLabel45"); // NOI18N

        jtf_email2.setName("jtf_email2"); // NOI18N
        jtf_email2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtf_email2ActionPerformed(evt);
            }
        });

        jtf_direccion3.setName("jtf_direccion3"); // NOI18N
        jtf_direccion3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtf_direccion3ActionPerformed(evt);
            }
        });

        jLabel46.setText(resourceMap.getString("jLabel46.text")); // NOI18N
        jLabel46.setName("jLabel46"); // NOI18N

        jtf_rfc1.setName("jtf_rfc1"); // NOI18N
        jtf_rfc1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtf_rfc1ActionPerformed(evt);
            }
        });

        jLabel47.setText(resourceMap.getString("jLabel47.text")); // NOI18N
        jLabel47.setName("jLabel47"); // NOI18N

        jtf_tel.setName("jtf_tel"); // NOI18N
        jtf_tel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtf_telActionPerformed(evt);
            }
        });

        jLabel48.setText(resourceMap.getString("jLabel48.text")); // NOI18N
        jLabel48.setName("jLabel48"); // NOI18N

        jLabel49.setText(resourceMap.getString("jLabel49.text")); // NOI18N
        jLabel49.setName("jLabel49"); // NOI18N

        jtf_atnventas.setName("jtf_atnventas"); // NOI18N
        jtf_atnventas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtf_atnventasActionPerformed(evt);
            }
        });

        jLabel50.setText(resourceMap.getString("jLabel50.text")); // NOI18N
        jLabel50.setName("jLabel50"); // NOI18N

        jtf_atncobra.setName("jtf_atncobra"); // NOI18N
        jtf_atncobra.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtf_atncobraActionPerformed(evt);
            }
        });

        jtf_ffecha.setText(resourceMap.getString("jtf_ffecha.text")); // NOI18N
        jtf_ffecha.setAutoscrolls(false);
        jtf_ffecha.setName("jtf_ffecha"); // NOI18N

        javax.swing.GroupLayout jPanel14Layout = new javax.swing.GroupLayout(jPanel14);
        jPanel14.setLayout(jPanel14Layout);
        jPanel14Layout.setHorizontalGroup(
            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel14Layout.createSequentialGroup()
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel14Layout.createSequentialGroup()
                        .addComponent(jLabel39)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtf_domcolonia1, javax.swing.GroupLayout.DEFAULT_SIZE, 185, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel43)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtf_dompobla1, javax.swing.GroupLayout.PREFERRED_SIZE, 251, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel45)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtf_email2, javax.swing.GroupLayout.PREFERRED_SIZE, 152, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(212, 212, 212))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel14Layout.createSequentialGroup()
                        .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(jPanel14Layout.createSequentialGroup()
                                .addContainerGap()
                                .addComponent(jtf_ffecha, javax.swing.GroupLayout.PREFERRED_SIZE, 137, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jtf_idcliente1, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel41, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jtf_cliente, javax.swing.GroupLayout.PREFERRED_SIZE, 243, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel44)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jtf_domcalle1, javax.swing.GroupLayout.PREFERRED_SIZE, 204, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(188, 188, 188))
                            .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel14Layout.createSequentialGroup()
                                    .addComponent(jLabel40)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jtf_cp, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(jLabel47)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jtf_rfc1, javax.swing.GroupLayout.DEFAULT_SIZE, 123, Short.MAX_VALUE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jLabel48)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jtf_tel, javax.swing.GroupLayout.DEFAULT_SIZE, 149, Short.MAX_VALUE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jLabel46)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jtf_direccion3, javax.swing.GroupLayout.PREFERRED_SIZE, 146, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(210, 210, 210))
                                .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel14Layout.createSequentialGroup()
                                    .addContainerGap()
                                    .addComponent(jLabel49)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jtf_atnventas, javax.swing.GroupLayout.PREFERRED_SIZE, 186, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jLabel50)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jtf_atncobra, javax.swing.GroupLayout.PREFERRED_SIZE, 183, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jLabel42)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jtf_observaciones1, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE))))
                        .addGap(12, 12, 12)))
                .addContainerGap())
        );
        jPanel14Layout.setVerticalGroup(
            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel14Layout.createSequentialGroup()
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jtf_idcliente1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel41)
                    .addComponent(jtf_cliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jtf_ffecha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel44)
                    .addComponent(jtf_domcalle1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel39)
                    .addComponent(jtf_domcolonia1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel43)
                    .addComponent(jtf_dompobla1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jtf_email2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel45))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel40)
                    .addComponent(jtf_cp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel47)
                    .addComponent(jtf_rfc1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jtf_tel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel48)
                    .addComponent(jLabel46)
                    .addComponent(jtf_direccion3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jtf_atnventas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel49)
                    .addComponent(jLabel50)
                    .addComponent(jtf_atncobra, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel42)
                    .addComponent(jtf_observaciones1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
        );

        jScrollPane12.setName("jScrollPane12"); // NOI18N

        jt_formatofactura1.setModel(this.jtable_modelo_facturabloque);
        jt_formatofactura1.setName("jt_formatofactura1"); // NOI18N
        // TODO add your handling code here:

        jt_foliosdetalle.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {

                dioclick(evt);
                //System.out.println(" double click" );

            }
        });
        jt_foliosdetalle.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                jt_foliosdetalleKeyPressed(evt);
            }
        });
        jScrollPane12.setViewportView(jt_formatofactura1);

        jScrollPane13.setName("jScrollPane13"); // NOI18N

        jt_formatofactura2.setModel(this.jtable_modelo_facturacompleta);
        jt_formatofactura2.setName("jt_formatofactura2"); // NOI18N
        // TODO add your handling code here:

        jt_foliosdetalle.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {

                dioclick(evt);
                //System.out.println(" double click" );

            }
        });
        jt_foliosdetalle.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                jt_foliosdetalleKeyPressed(evt);
            }
        });
        jScrollPane13.setViewportView(jt_formatofactura2);

        jtf_fsubtotal.setEditable(false);
        jtf_fsubtotal.setText(resourceMap.getString("jtf_fsubtotal.text")); // NOI18N
        jtf_fsubtotal.setName("jtf_fsubtotal"); // NOI18N

        jtf_fImpuesto.setEditable(false);
        jtf_fImpuesto.setName("jtf_fImpuesto"); // NOI18N

        jtf_ftotal.setEditable(false);
        jtf_ftotal.setName("jtf_ftotal"); // NOI18N

        jLabel51.setText(resourceMap.getString("jLabel51.text")); // NOI18N
        jLabel51.setName("jLabel51"); // NOI18N

        jLabel52.setText(resourceMap.getString("jLabel52.text")); // NOI18N
        jLabel52.setName("jLabel52"); // NOI18N

        jLabel53.setText(resourceMap.getString("jLabel53.text")); // NOI18N
        jLabel53.setName("jLabel53"); // NOI18N

        jtf_fpimpu.setText(resourceMap.getString("jtf_fpimpu.text")); // NOI18N
        jtf_fpimpu.setToolTipText(resourceMap.getString("jtf_fpimpu.toolTipText")); // NOI18N
        jtf_fpimpu.setName("jtf_fpimpu"); // NOI18N
        jtf_fpimpu.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtf_fpimpuActionPerformed(evt);
            }
        });

        jLabel54.setText(resourceMap.getString("jLabel54.text")); // NOI18N
        jLabel54.setName("jLabel54"); // NOI18N

        jtf_fotosartxpag.setText(resourceMap.getString("jtf_fotosartxpag.text")); // NOI18N
        jtf_fotosartxpag.setToolTipText(resourceMap.getString("jtf_fotosartxpag.toolTipText")); // NOI18N
        jtf_fotosartxpag.setName("jtf_fotosartxpag"); // NOI18N
        jtf_fotosartxpag.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtf_fotosartxpagActionPerformed(evt);
            }
        });

        jlbl_paginas.setText(resourceMap.getString("jlbl_paginas.text")); // NOI18N
        jlbl_paginas.setName("jlbl_paginas"); // NOI18N

        jbtn_anterior.setText(resourceMap.getString("jbtn_anterior.text")); // NOI18N
        jbtn_anterior.setName("jbtn_anterior"); // NOI18N
        jbtn_anterior.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_anteriorActionPerformed(evt);
            }
        });

        jtf_paginaactual.setText(resourceMap.getString("jtf_paginaactual.text")); // NOI18N
        jtf_paginaactual.setToolTipText(resourceMap.getString("jtf_paginaactual.toolTipText")); // NOI18N
        jtf_paginaactual.setName("jtf_paginaactual"); // NOI18N
        jtf_paginaactual.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtf_paginaactualActionPerformed(evt);
            }
        });

        jbtn_siguiente.setText(resourceMap.getString("jbtn_siguiente.text")); // NOI18N
        jbtn_siguiente.setName("jbtn_siguiente"); // NOI18N
        jbtn_siguiente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_siguienteActionPerformed(evt);
            }
        });

        jlbl_paginas1.setText(resourceMap.getString("jlbl_paginas1.text")); // NOI18N
        jlbl_paginas1.setName("jlbl_paginas1"); // NOI18N

        jtf_fdesc.setText(resourceMap.getString("jtf_fdesc.text")); // NOI18N
        jtf_fdesc.setToolTipText(resourceMap.getString("jtf_fdesc.toolTipText")); // NOI18N
        jtf_fdesc.setName("jtf_fdesc"); // NOI18N

        jLabel55.setText(resourceMap.getString("jLabel55.text")); // NOI18N
        jLabel55.setName("jLabel55"); // NOI18N

        jLabel56.setText(resourceMap.getString("jLabel56.text")); // NOI18N
        jLabel56.setName("jLabel56"); // NOI18N

        jtf_fdescuento.setEditable(false);
        jtf_fdescuento.setName("jtf_fdescuento"); // NOI18N

        btn_imprimir1.setIcon(resourceMap.getIcon("btn_imprimir1.icon")); // NOI18N
        btn_imprimir1.setText(resourceMap.getString("btn_imprimir1.text")); // NOI18N
        btn_imprimir1.setName("btn_imprimir1"); // NOI18N
        btn_imprimir1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_imprimir1ActionPerformed(evt);
            }
        });

        jtf_importepesos.setText(resourceMap.getString("jtf_importepesos.text")); // NOI18N
        jtf_importepesos.setName("jtf_importepesos"); // NOI18N

        jtf_fmargen.setText(resourceMap.getString("jtf_fmargen.text")); // NOI18N
        jtf_fmargen.setToolTipText(resourceMap.getString("jtf_fmargen.toolTipText")); // NOI18N
        jtf_fmargen.setName("jtf_fmargen"); // NOI18N
        jtf_fmargen.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtf_fmargenActionPerformed(evt);
            }
        });

        jLabel57.setText(resourceMap.getString("jLabel57.text")); // NOI18N
        jLabel57.setToolTipText(resourceMap.getString("jLabel57.toolTipText")); // NOI18N
        jLabel57.setName("jLabel57"); // NOI18N

        javax.swing.GroupLayout jPanel13Layout = new javax.swing.GroupLayout(jPanel13);
        jPanel13.setLayout(jPanel13Layout);
        jPanel13Layout.setHorizontalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel13Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel13Layout.createSequentialGroup()
                        .addComponent(jScrollPane11, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel14, javax.swing.GroupLayout.PREFERRED_SIZE, 749, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel13Layout.createSequentialGroup()
                            .addComponent(jScrollPane13, javax.swing.GroupLayout.PREFERRED_SIZE, 413, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jScrollPane12, javax.swing.GroupLayout.DEFAULT_SIZE, 451, Short.MAX_VALUE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))
                        .addGroup(jPanel13Layout.createSequentialGroup()
                            .addComponent(jtf_importepesos, javax.swing.GroupLayout.PREFERRED_SIZE, 222, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(18, 18, 18)
                            .addComponent(btn_imprimir1)
                            .addGap(165, 165, 165)))
                    .addGroup(jPanel13Layout.createSequentialGroup()
                        .addComponent(jbtn_anterior)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jtf_paginaactual, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jbtn_siguiente))
                    .addGroup(jPanel13Layout.createSequentialGroup()
                        .addComponent(jLabel57)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtf_fmargen, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jlbl_paginas1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtf_fotosartxpag, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jlbl_paginas)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel55)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtf_fdesc, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel54)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtf_fpimpu, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel51)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtf_fsubtotal, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel56)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtf_fdescuento, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel52)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtf_fImpuesto, javax.swing.GroupLayout.PREFERRED_SIZE, 57, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel53)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtf_ftotal, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(47, 47, 47))
        );
        jPanel13Layout.setVerticalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel13Layout.createSequentialGroup()
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel14, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jScrollPane11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jScrollPane12, javax.swing.GroupLayout.DEFAULT_SIZE, 214, Short.MAX_VALUE)
                    .addComponent(jScrollPane13, javax.swing.GroupLayout.DEFAULT_SIZE, 214, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel57)
                    .addComponent(jtf_fmargen, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel55)
                    .addComponent(jlbl_paginas1)
                    .addComponent(jtf_fotosartxpag, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jlbl_paginas)
                    .addComponent(jtf_fdesc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel54)
                    .addComponent(jtf_fpimpu, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel51)
                    .addComponent(jtf_fsubtotal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel56)
                    .addComponent(jtf_fdescuento, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jtf_ftotal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel52)
                    .addComponent(jtf_fImpuesto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel53))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jbtn_anterior)
                        .addComponent(jbtn_siguiente)
                        .addComponent(jtf_paginaactual, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jtf_importepesos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(btn_imprimir1)))
                .addContainerGap())
        );

        jTabbedPane1.addTab(resourceMap.getString("jPanel13.TabConstraints.tabTitle"), jPanel13); // NOI18N

        jMenuBar1.setName("jMenuBar1"); // NOI18N

        jMenu1.setText(resourceMap.getString("jMenu1.text")); // NOI18N
        jMenu1.setName("jMenu1"); // NOI18N
        jMenu1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenu1ActionPerformed(evt);
            }
        });

        jMenuItem2.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_I, java.awt.event.InputEvent.ALT_MASK));
        jMenuItem2.setText(resourceMap.getString("jMenuItem2.text")); // NOI18N
        jMenuItem2.setName("jMenuItem2"); // NOI18N
        jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem2ActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItem2);

        jMenuItem5.setText(resourceMap.getString("jMenuItem5.text")); // NOI18N
        jMenuItem5.setName("jMenuItem5"); // NOI18N
        jMenuItem5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem5ActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItem5);

        jMenuItem4.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_G, java.awt.event.InputEvent.ALT_MASK));
        jMenuItem4.setText(resourceMap.getString("jMenuItem4.text")); // NOI18N
        jMenuItem4.setName("jMenuItem4"); // NOI18N
        jMenuItem4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem4ActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItem4);

        jmni_guardarf7.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F7, 0));
        jmni_guardarf7.setText(resourceMap.getString("jmni_guardarf7.text")); // NOI18N
        jmni_guardarf7.setName("jmni_guardarf7"); // NOI18N
        jmni_guardarf7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmni_guardarf7ActionPerformed(evt);
            }
        });
        jMenu1.add(jmni_guardarf7);

        jMenuItem1.setText(resourceMap.getString("jMenuItem1.text")); // NOI18N
        jMenuItem1.setName("jMenuItem1"); // NOI18N
        jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem1ActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItem1);

        jMenuItem7.setText(resourceMap.getString("jMenuItem7.text")); // NOI18N
        jMenuItem7.setName("jMenuItem7"); // NOI18N
        jMenuItem7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem7ActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItem7);

        jmni_salir.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.ALT_MASK));
        jmni_salir.setIcon(resourceMap.getIcon("jmni_salir.icon")); // NOI18N
        jmni_salir.setText(resourceMap.getString("jmni_salir.text")); // NOI18N
        jmni_salir.setName("jmni_salir"); // NOI18N
        jmni_salir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmni_salirActionPerformed(evt);
            }
        });
        jMenu1.add(jmni_salir);

        jMenuBar1.add(jMenu1);

        jMenu2.setText(resourceMap.getString("jMenu2.text")); // NOI18N
        jMenu2.setName("jMenu2"); // NOI18N

        jMenuItem6.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ESCAPE, 0));
        jMenuItem6.setText(resourceMap.getString("jMenuItem6.text")); // NOI18N
        jMenuItem6.setName("jMenuItem6"); // NOI18N
        jMenuItem6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem6ActionPerformed(evt);
            }
        });
        jMenu2.add(jMenuItem6);

        jmni_irabusqueda.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F, java.awt.event.InputEvent.CTRL_MASK));
        jmni_irabusqueda.setText(resourceMap.getString("jmni_irabusqueda.text")); // NOI18N
        jmni_irabusqueda.setName("jmni_irabusqueda"); // NOI18N
        jmni_irabusqueda.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmni_irabusquedaActionPerformed(evt);
            }
        });
        jMenu2.add(jmni_irabusqueda);

        jmni_impresioncosto.setText(resourceMap.getString("jmni_impresioncosto.text")); // NOI18N
        jmni_impresioncosto.setName("jmni_impresioncosto"); // NOI18N
        jmni_impresioncosto.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmni_impresioncostoActionPerformed(evt);
            }
        });
        jMenu2.add(jmni_impresioncosto);

        jMenuBar1.add(jMenu2);

        jMenu3.setText(resourceMap.getString("jMenu3.text")); // NOI18N
        jMenu3.setName("jMenu3"); // NOI18N

        jMenuItem3.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A, java.awt.event.InputEvent.ALT_MASK));
        jMenuItem3.setText(resourceMap.getString("jMenuItem3.text")); // NOI18N
        jMenuItem3.setName("jMenuItem3"); // NOI18N
        jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem3ActionPerformed(evt);
            }
        });
        jMenu3.add(jMenuItem3);

        jmni_creasugerencia.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_U, java.awt.event.InputEvent.ALT_MASK));
        jmni_creasugerencia.setText(resourceMap.getString("jmni_creasugerencia.text")); // NOI18N
        jmni_creasugerencia.setName("jmni_creasugerencia"); // NOI18N
        jmni_creasugerencia.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmni_creasugerenciaActionPerformed(evt);
            }
        });
        jMenu3.add(jmni_creasugerencia);

        jMenuBar1.add(jMenu3);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel3, 0, 932, Short.MAX_VALUE)
            .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 932, Short.MAX_VALUE)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 451, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jbtn_salirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_salirActionPerformed

      this.jmni_salirActionPerformed(evt);
}//GEN-LAST:event_jbtn_salirActionPerformed

    private void btn_imprimirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_imprimirActionPerformed

        // TODO add your handling code here:
        float filas = this.jtable_modelo_detalle.getRowCount() ;
        float paginas = filas /25;
        int ni=0;
        for(ni=0;ni<paginas;ni++)
             {
                 this.imprimir(ni,paginas);
             }
        
    
    }//GEN-LAST:event_btn_imprimirActionPerformed

    private void jMenu1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenu1ActionPerformed


        //this.imprimir();
    }//GEN-LAST:event_jMenu1ActionPerformed

    private void jmni_salirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_salirActionPerformed
        // TODO add your handling code here:
   if(JOptionPane.showConfirmDialog(null, "Desea Salir?")==0) {
             this.dispose();
        }
}//GEN-LAST:event_jmni_salirActionPerformed

    private void jbtn_helpayudameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_helpayudameActionPerformed
        // TODO add your handling code here:
        this.ayuda();
    }//GEN-LAST:event_jbtn_helpayudameActionPerformed

    private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem3ActionPerformed
        // TODO add your handling code here:
        this.ayuda();
    }//GEN-LAST:event_jMenuItem3ActionPerformed

    private void btn_guardarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_guardarActionPerformed
        // TODO add your handling code here:
        ResultSet rs = null;
        float sobrante=0,faltante=0;
        int nobjetotabla=this.jt_foliosdetalle.getRowCount();
        int fi=0,controdif=0,opciondif=0;
        float diferencia=0;
        String mensadif="";
        JPasswordField pwd = new JPasswordField(10);
        //lanso la confirmacion de password
       // String[] options = {"OK", "Cancel"};
         String etifal=JOptionPane.showInputDialog("Ingresa Etiquetas en mal Estado:",this.jtf_etiquetasfallidas.getText());
         this.jtf_etiquetasfallidas.setText(etifal);
        int action = JOptionPane.showConfirmDialog(null, pwd,"Contraseña:(Use Tab p/moverse o Mause)",JOptionPane.OK_CANCEL_OPTION);
       // int action = JOptionPane.showOptionDialog(null, pwd,"Contraseña:(Use Tab p/moverse o Mause)",JOptionPane.OK_CANCEL_OPTION,JOptionPane.QUESTION_MESSAGE, null, options, null);
       if(action < 0)
            {
            JOptionPane.showMessageDialog(null,"No se realiza Proceso, Gracias");
            }
        else
            {
            //comparo si la contraseña es apropiada
          if(variables_global.getPassword().equals(String.valueOf(pwd.getPassword())))
              {//inicia trabajo para actualizar diferencias
                for(fi=0;fi<nobjetotabla;fi++)
                        {
                        sobrante=0;
                        faltante=0;
                          try{
                                sobrante = Float.valueOf(this.jt_foliosdetalle.getValueAt(fi, 7).toString()).floatValue();
                            }catch (NumberFormatException nfe)
                            {
                              sobrante=0;
                            }

                         try{
                                faltante = Float.valueOf(this.jt_foliosdetalle.getValueAt(fi, 6).toString()).floatValue();
                            }catch (NumberFormatException nfe)
                            {
                                faltante=0;
                            }
                           diferencia=(sobrante)+(faltante*-1);
                           if (diferencia != 0)
                               {
                               System.out.println("clave:"+this.jt_foliosdetalle.getValueAt(fi,1).toString()+"Diferencia"+diferencia);
                               mensadif+="clave: "+this.jt_foliosdetalle.getValueAt(fi,1).toString()+"  Diferencia: "+diferencia+"\n";
                               }
        }//fin del for
                if (mensadif.length() > 0)
                    {
                        JOptionPane.showMessageDialog(null,mensadif, "Sistema Integral(Verificar Diferencias)",1);
                    }
                else
                    {
                      JOptionPane.showMessageDialog(null,mensadif+"Usted Reportara Recepcion Sin Diferencias", "Sistema Integral(Verificar Diferencias)",1);
                    }
                if(JOptionPane.showConfirmDialog(null, "Documento sera Recepcionado. Estan correcto sus Datos?")==0)
                    {
                       for(fi=0;fi<nobjetotabla;fi++)
                            {
                            sobrante=0;
                            faltante=0;
                                try{
                                        sobrante = Float.valueOf(this.jt_foliosdetalle.getValueAt(fi, 7).toString()).floatValue();
                                        if (sobrante > 0)
                                           {
                                                 jtable_modelo_sobrante.addRow(new Object[]{this.jt_foliosdetalle.getValueAt(fi, 1).toString(),sobrante,this.jt_foliosdetalle.getValueAt(fi, 2).toString(),this.jt_foliosdetalle.getValueAt(fi, 4).toString(),"0",sobrante*Float.valueOf(this.jt_foliosdetalle.getValueAt(fi, 4).toString()).floatValue(),"0","0","1"});
                                                 this.jtf_importesob.setText(String.valueOf(Float.valueOf(this.jtf_importesob.getText().toString()).floatValue()+(sobrante*Float.valueOf(this.jt_foliosdetalle.getValueAt(fi, 4).toString()).floatValue())));
                                           }
                                    }catch (NumberFormatException nfe)
                                    {
                                          //System.out.println("NumberFormatException: " + nfe.getMessage());
                                        sobrante=0;
                                    }
                                try{
                                    faltante = Float.valueOf(this.jt_foliosdetalle.getValueAt(fi, 6).toString()).floatValue();
                                    if (faltante > 0)
                                           {
                                                 jtable_modelo_faltante.addRow(new Object[]{this.jt_foliosdetalle.getValueAt(fi, 1).toString(),faltante,this.jt_foliosdetalle.getValueAt(fi, 2).toString(),this.jt_foliosdetalle.getValueAt(fi, 4).toString(),"0",faltante*Float.valueOf(this.jt_foliosdetalle.getValueAt(fi, 4).toString()).floatValue(),"0","0","1"});
                                                 this.jtf_importefal.setText(String.valueOf(Float.valueOf(this.jtf_importefal.getText().toString()).floatValue()+(faltante*Float.valueOf(this.jt_foliosdetalle.getValueAt(fi, 4).toString()).floatValue())));
                                           }
                                }catch (NumberFormatException nfe)
                                    {
                                      //System.out.println("NumberFormatException: " + nfe.getMessage());
                                    faltante=0;
                                    }
                                    diferencia=(sobrante)+(faltante*-1);
                                    if (diferencia != 0)
                                           {
                                                //x.recepcion_diferencias(diferencia,this.tf_foliotienda.getText().toString(),this.jt_foliosdetalle.getValueAt(fi,1).toString(),1);
                                                //rs = x.sieuno_executediversosv2("select * from  x1_catalogo_view_x1pro_det_dif("+diferencia+",'"+this.tf_foliotienda.getText().toString()+"','"+this.jt_foliosdetalle.getValueAt(fi,1).toString()+"',1) as (id integer);",variables_global.getconexiongral());
                                                //System.out.println("clave:"+this.jt_foliosdetalle.getValueAt(fi,1).toString()+"Diferencia"+diferencia);
                                           controdif=1;
                                           }
                        }//fin del for
                       //rs=x.recepciona(this.tf_foliotienda.getText().toString());
                        java.util.Vector arreglodesobrantes=this.jtable_modelo_sobrante.getDataVector();
                        String articulos_sobrantes=arreglodesobrantes.toString();
                        articulos_sobrantes=articulos_sobrantes.replace('[','{');
                        articulos_sobrantes=articulos_sobrantes.replace(']','}');
                        java.util.Vector arreglodefaltantes=this.jtable_modelo_faltante.getDataVector();
                        String articulos_faltantes=arreglodefaltantes.toString(),textodif="";
                        articulos_faltantes=articulos_faltantes.replace('[','{');
                        articulos_faltantes=articulos_faltantes.replace(']','}');
                        int banderacorrecto=0,foliosob=0,foliofal=0;
                        String texto="select * from x1distribucion_ventas_add_sieuno_bodega('"+this.tf_foliotienda.getText().toString()+"') as (status smallint)";
                         System.out.println(texto);
                       try
                            {
                                rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                                while (rs.next())
                                    {
                                        if (Integer.valueOf(rs.getString(1)) < 3)
                                            {
                                            banderacorrecto=1;
                                            JOptionPane.showMessageDialog(null," Recepcion Correcta, Gracias", "Sistema Integral(Detalle Recepcion) : Confirmacion",1);
                                                
                                                //this.imprimirdif();
                                                this.btn_guardar.setVisible(false);
                                            }
                                        else
                                            {
                                                  JOptionPane.showMessageDialog(null," Recepcion Incorrecta ", "Sistema Integral(Detalle Recepcion) : Error",1);
                                            }
                                    }

                            }
                            catch(Exception e)
                                {
                                    System.out.println(e.getMessage());
                                    JOptionPane.showMessageDialog(null," Recepcion Incorrecta ", "Sistema Integral(Detalle Recepcion) : Error",1);
                                }

                      if (banderacorrecto>0)
                      {
                          if(this.jtable_modelo_sobrante.getRowCount()>0)
                            {
                                opciondif=2;
                            }
                          if(this.jtable_modelo_faltante.getRowCount()>0)
                            {
                                opciondif=3;
                            }
                            if((this.jtable_modelo_faltante.getRowCount()>0) && (this.jtable_modelo_sobrante.getRowCount()>0))
                            {
                                opciondif=1;
                        }
                          try{
                                    textodif="select * from  x1distribucion_terminados_ventas_recepcion("+opciondif+",'"+this.tf_foliotienda.getText().toString()+"','"+articulos_sobrantes+"','"+articulos_faltantes+"') ;";
                                    System.out.println(textodif);
                                    rs = x.sieuno_executediversosv2(textodif,variables_global.getconexiongral());
                            }
                           catch(Exception e){
                                    System.out.println(e.getMessage());
                           }
                          if(this.jtable_modelo_sobrante.getRowCount()>0)
                            {
                                    try
                                        {
                                            textodif="select insercion_requisicion_producto_movimientos_extras('"+this.find_esquema(this.jtf_idc.getText().toString())+"',7,'Ent xSobrante','"+articulos_sobrantes+"','Folio Recepcion:"+this.tf_foliotienda.getText().toString()+"',"+this.jtf_importesob.getText()+",0) ;";
                                            System.out.println(textodif);
                                            rs = x.sieuno_executediversosv2(textodif,variables_global.getconexiongral());
                                            while (rs.next())
                                                {
                                                    foliosob=rs.getInt(1);
                                                }
                                        }
                                        catch(Exception e)
                                                {
                                                    System.out.println(e.getMessage());
                                                }
                            }
                           if(this.jtable_modelo_faltante.getRowCount()>0)
                            {
                                try
                                       {
                                            textodif="select insercion_requisicion_producto_movimientos_extras('"+this.find_esquema(this.jtf_idc.getText().toString())+"',7,'Sal Faltante','"+articulos_faltantes+"','Folio Recepcion:"+this.tf_foliotienda.getText().toString()+"',"+this.jtf_importefal.getText()+",0) ;";
                                            System.out.println(textodif);
                                            rs = x.sieuno_executediversosv2(textodif,variables_global.getconexiongral());
                                            while (rs.next())
                                                {
                                                        foliofal=rs.getInt(1);
                                                }
                                        }
                                        catch(Exception e)
                                        {
                                                System.out.println(e.getMessage());
                                        }
                                }
                          try{
                                    textodif="select  * from x1distribucion_terminados_ventas_recepcion_detalle(1,'"+this.tf_foliotienda.getText().toString()+"','"+foliosob+"','"+foliofal+"','"+variables_global.getId_empleado()+"','"+this.jtf_etiquetasfallidas.getText()+"','"+this.jtf_etiquetasfaltante.getText()+"','0.20','"+this.tf_foliodistribucion.getText()+"') ;";
                                    System.out.println(textodif);
                                    rs = x.sieuno_executediversosv2(textodif,variables_global.getconexiongral());
                           }
                           catch(Exception e)
                           {
                                    System.out.println(e.getMessage());
                           }
                           this.imprimirdif();
                      }
                    }//fin del if qu confirmo guardar diferencia
              }
          else
              {
                    JOptionPane.showMessageDialog(null,"por Favor teclee su contraseña coreectamente, verifique mayusculas en teclado");
              }
        }
    }//GEN-LAST:event_btn_guardarActionPerformed

 private void cambiartamanofilas()
 {
        int numerofilas=this.jtable_modelo_detalle.getRowCount();
            for(int i = 0 ;i < numerofilas; i++)
                {
                     jt_foliosdetalle.setRowHeight(i, 70);
                }
  }
private void recepcionar_aplicardiferencias()
 {
                    int banderacorrecto=0,foliosob=0,foliofal=0;
                     java.util.Vector arreglodesobrantes=this.jtable_modelo_sobrante.getDataVector();
                     String articulos_sobrantes=arreglodesobrantes.toString();
                     articulos_sobrantes=articulos_sobrantes.replace('[','{');
                     articulos_sobrantes=articulos_sobrantes.replace(']','}');
                      java.util.Vector arreglodefaltantes=this.jtable_modelo_faltante.getDataVector();
                     String articulos_faltantes=arreglodefaltantes.toString(),textodif="";
                     articulos_faltantes=articulos_faltantes.replace('[','{');
                     articulos_faltantes=articulos_faltantes.replace(']','}');
                          if(this.jtable_modelo_sobrante.getRowCount()>0)
                            {
                                    try
                                        {
                                            textodif="select insercion_requisicion_producto_movimientos_extras('"+this.find_esquema(this.jtf_idc.getText().toString())+"',7,'Ent xSobrante','"+articulos_sobrantes+"','Folio Recepcion:"+this.tf_foliotienda.getText().toString()+"',"+this.jtf_importesob.getText()+",0) ;";
                                            System.out.println(textodif);
                                            rs = x.sieuno_executediversosv2(textodif,variables_global.getconexiongral());
                                            while (rs.next())
                                                {
                                                    foliosob=rs.getInt(1);
                                                }
                                        }
                                        catch(Exception e)
                                                {
                                                    System.out.println(e.getMessage());
                                                }
                            }
                           if(this.jtable_modelo_faltante.getRowCount()>0)
                            {
                                try
                                       {
                                            textodif="select insercion_requisicion_producto_movimientos_extras('"+this.find_esquema(this.jtf_idc.getText().toString())+"',7,'Sal Faltante','"+articulos_faltantes+"','Folio Recepcion:"+this.tf_foliotienda.getText().toString()+"',"+this.jtf_importefal.getText()+",0) ;";
                                            System.out.println(textodif);
                                            rs = x.sieuno_executediversosv2(textodif,variables_global.getconexiongral());
                                            while (rs.next())
                                                {
                                                        foliofal=rs.getInt(1);
                                                }
                                        }
                                        catch(Exception e)
                                        {
                                                System.out.println(e.getMessage());
                                        }
                                }
                          try{
                                    textodif="select  * from x1distribucion_terminados_ventas_recepcion_detalle(1,'"+this.tf_foliotienda.getText().toString()+"','"+foliosob+"','"+foliofal+"','"+variables_global.getId_empleado()+"') ;";
                                    System.out.println(textodif);
                                    rs = x.sieuno_executediversosv2(textodif,variables_global.getconexiongral());
                           }
                           catch(Exception e)
                           {
                                    System.out.println(e.getMessage());
                           }
  }

private void paginas()
    {
        float totalpaginas=0,dif=0,artxpag=Float.valueOf(this.jtf_fotosartxpag.getText().toString());
        if(this.jt_formatofactura2.getRowCount()<=artxpag)
            {
                totalpaginas=1;
            }
        else
            {
                totalpaginas=this.jt_formatofactura2.getRowCount()/artxpag;
            }
        String paginastexto="",paginaspartido[]=null;
        DecimalFormat miformatint = new DecimalFormat("############");
        paginastexto=miformatint.format(totalpaginas);
        dif=totalpaginas-Float.valueOf(paginastexto);
        System.out.println("pagina y fracc:"+totalpaginas+" pagina:"+paginastexto+" registros:"+this.jtable_modelo_facturacompleta.getRowCount());

        if (dif != 0)
            {
                totalpaginas=Float.valueOf(paginastexto)+1;
            }
        else
            {
                totalpaginas=Float.valueOf(paginastexto);
            }
        this.jlbl_paginas.setText("PAGINAS :"+totalpaginas);
    }

    private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem4ActionPerformed
        // TODO add your handling code here:
        this.btn_guardarActionPerformed(evt);
    }//GEN-LAST:event_jMenuItem4ActionPerformed

    private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed
        // TODO add your handling code here:
        this.btn_imprimirActionPerformed(evt);
    }//GEN-LAST:event_jMenuItem2ActionPerformed

    private void jMenuItem5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem5ActionPerformed
        // TODO add your handling code here:
        this.imprimirdif();
    }//GEN-LAST:event_jMenuItem5ActionPerformed

    private void tf_fechaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tf_fechaActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_tf_fechaActionPerformed

    private void tf_foliotiendaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tf_foliotiendaActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_tf_foliotiendaActionPerformed

    private void tf_clienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tf_clienteActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_tf_clienteActionPerformed

    private void jbtn_fechallegatiendaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_fechallegatiendaActionPerformed
        // TODO add your handling code here:
      if(JOptionPane.showConfirmDialog(null, "Mercancia Recibida en Tienda Tiene 3 Dias Para Recepcionar. Estan correcto sus Datos?")==0)
            {
                String retorno="";
                rs = x.sieuno_executediversosv2("select * from x1distribucion_ventasactualiza('"+this.tf_foliotienda.getText()+"','',3);",variables_global.getconexiongral());
                                try
                                    {
                                    while (rs.next())
                                            {
                                                retorno=rs.getString(1);
                                            }
                                     }
                                 catch(Exception e)
                                     {
                                            System.out.println(e.getMessage());
                                     }
                                 if (retorno.equals("1"))
                                     {
                                         this.jtf_fecharecibidotienda.setText(this.fechaeuropea(fechahoy));
                                         this.btn_guardar.setVisible(true);
                                     }
        }
    }//GEN-LAST:event_jbtn_fechallegatiendaActionPerformed

    private void jmni_creasugerenciaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_creasugerenciaActionPerformed
        // TODO add your handling code here:
        this.crearcomentario();
    }//GEN-LAST:event_jmni_creasugerenciaActionPerformed

    private void jMenuItem6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem6ActionPerformed
        // TODO add your handling code here:
        this.jmni_salirActionPerformed(evt);
   
    }//GEN-LAST:event_jMenuItem6ActionPerformed

    private void jmni_irabusquedaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_irabusquedaActionPerformed
        // TODO add your handling code here:
       // this.jtf_buscarenjtable.requestFocus();
    }//GEN-LAST:event_jmni_irabusquedaActionPerformed

    private void jmni_guardarf7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_guardarf7ActionPerformed
        // TODO add your handling code here:
        this.btn_guardarActionPerformed(evt);
    }//GEN-LAST:event_jmni_guardarf7ActionPerformed

    private void jbtn_actualizarobserActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_actualizarobserActionPerformed
        // TODO add your handling code here:
        String retorno="",texto="";
        if(JOptionPane.showConfirmDialog(null, "Desea Actualizar Observaciones?")==0)
        {
            texto="select * from x1distribucion_ventasactualiza('"+this.tf_foliotienda.getText().toString()+"','"+this.jtf_observ_update.getText().trim().replace(",", "")+"',2);";
            System.out.println(texto);
            try
                {
                    rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                    while (rs.next())
                        {
                            retorno=rs.getString(1);
                        }
                }
                catch(Exception e)
                    {
                        System.out.println(e.getMessage());
                    }
                    if (retorno.equals("1"))
                                     {

                                     }
        }
}//GEN-LAST:event_jbtn_actualizarobserActionPerformed

    private void jTabbedPane1StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jTabbedPane1StateChanged
        // TODO add your handling code here:
         int indexactual=this.jTabbedPane1.getSelectedIndex();
         if((indexactual==3) && (yacarguerecaux==0))
            {
                yacarguerecaux=1;
                this.jtf_observ_update.setText(this.ta_observaciones.getText().trim());
                this.carga_datos_recepcionaux(1,this.tf_foliotienda.getText().toString());
            }
         if((indexactual==4))
            {
                     this.carga_datos_fotospaginacion(Integer.valueOf(this.jtf_paginaactual.getText().toString()));
            }
         if(indexactual==6)
            {
              if(JOptionPane.showConfirmDialog(null, "Actualizar?")==0)
                {
                    /*x.estableceConexionexterna();
                    if(variables_global.getError_ingreso()==-1)
                        {
                            JOptionPane.showConfirmDialog(null, "Error! Servidor No responde,Intentolo mas Tarde?");
                        }
                    else
                        {
                        this.carga_datos_clientesexterno(4,this.tf_cliente.getText().toString());
                        x.cierraConexionexterna(variables_global.getconexiongralext());
                        }*/
                }
            }
    }//GEN-LAST:event_jTabbedPane1StateChanged

    private void jtf_domcalleActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_domcalleActionPerformed
        // TODO add your handling code here:
        this.jtf_domcolonia.requestFocus();
}//GEN-LAST:event_jtf_domcalleActionPerformed

    private void jtf_domcoloniaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_domcoloniaActionPerformed
        // TODO add your handling code here:
        // this.jtf_dompobla.requestFocus();
}//GEN-LAST:event_jtf_domcoloniaActionPerformed

    private void jtf_domcodActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_domcodActionPerformed
        // TODO add your handling code here:
        //this.jtf_domtelefono.requestFocus();
}//GEN-LAST:event_jtf_domcodActionPerformed

    private void jtf_telefonoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_telefonoActionPerformed
        // TODO add your handling code here:
        //this.jtf_empfoto.requestFocus();
}//GEN-LAST:event_jtf_telefonoActionPerformed

    private void jtf_direccion2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_direccion2ActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jtf_direccion2ActionPerformed

    private void jbtn_imprimirpedidoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_imprimirpedidoActionPerformed
        try {
            // TODO add your handling code here:
            this.jep_facturaexport.print();
        } catch (PrinterException ex) {
            Logger.getLogger(com_distri_folios_detalle.class.getName()).log(Level.SEVERE, null, ex);
        }
}//GEN-LAST:event_jbtn_imprimirpedidoActionPerformed

    private void jtf_observ_updateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_observ_updateActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jtf_observ_updateActionPerformed

    private void jtf_operorecepcionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_operorecepcionActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jtf_operorecepcionActionPerformed

    private void jtf_operorechoraActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_operorechoraActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jtf_operorechoraActionPerformed

    private void jtf_operosobfolActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_operosobfolActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jtf_operosobfolActionPerformed

    private void jtf_operofalfolActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_operofalfolActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jtf_operofalfolActionPerformed

    private void jcb_verfotos1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcb_verfotos1ActionPerformed
        // TODO add your handling code here:
        if(Integer.valueOf(this.jtf_operosobfol.getText().toString())>0)
            {
                articulos_sie_almacen_movi_extras_detalle fasamed=new articulos_sie_almacen_movi_extras_detalle(this.jtf_operosobfol.getText().toString(),this.find_idtie(this.jtf_idc.getText().toString()));
                fasamed.pack();
                fasamed.setVisible(true);
            }
    }//GEN-LAST:event_jcb_verfotos1ActionPerformed

    private void jcb_verfotos2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcb_verfotos2ActionPerformed
        // TODO add your handling code here:
          if(Integer.valueOf(this.jtf_operofalfol.getText().toString())>0)
            {
                articulos_sie_almacen_movi_extras_detalle fasamed=new articulos_sie_almacen_movi_extras_detalle(this.jtf_operofalfol.getText().toString(),this.find_idtie(this.jtf_idc.getText().toString()));
                fasamed.pack();
                fasamed.setVisible(true);
            }
    }//GEN-LAST:event_jcb_verfotos2ActionPerformed

    private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
        // TODO add your handling code here:
        if(variables_global.getnivelusu()<3)
        {
        if ((Integer.valueOf(this.jtf_operosobfol.getText().toString())==0) &&(Integer.valueOf(this.jtf_operofalfol.getText().toString())==0))
            {
                this.recepcionar_aplicardiferencias();
            }
        }
    }//GEN-LAST:event_jMenuItem1ActionPerformed

    private void jbtn_guardaexternaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_guardaexternaActionPerformed
        // TODO add your handling code here:
        if(this.tf_foliosig.getText().toString().length()==0)
        {
        x.estableceConexionexterna();
        int controlfolio=0;
        if(variables_global.getError_ingreso()==-1)
        {
            if(JOptionPane.showConfirmDialog(null, "Error! Servidor No responde,Intentolo mas Tarde?")==0)
                    {

                    }
        }
        else
        {
                         java.util.Vector arreglodearticulos=this.jtable_modelo_almacensur.getDataVector();
                        String articulos_papostgresql=arreglodearticulos.toString();
                        articulos_papostgresql=articulos_papostgresql.replace('[','{');
                        articulos_papostgresql=articulos_papostgresql.replace(']','}');
                        articulos_papostgresql=articulos_papostgresql.replace("null",".");
                        String texto="select * from x1distribucion_almacen_traspa_resurt("+"488"+",'"+this.fechaamericana(fechahoy)+"','Folio pedido:"+this.tf_foliotienda.getText()+"',1,'"+articulos_papostgresql+"');";
                        System.out.println(texto);
                            try {
                                rs=x.sieuno_executediversosv2(texto,variables_global.getconexiongralext());
                                while (rs.next())
                                        {
                                        controlfolio=rs.getInt(1);
                                        }
                                }
                                catch(Exception e)
                                    {
                                        System.out.println(e.getMessage());
                                        JOptionPane.showMessageDialog(null," Recepcion Incorrecta ", "Sistema Integral(Requisicion Almacen) : Error",1);
                                   }
                        if (controlfolio > 0)
                                {
                                    this.tf_foliosig.setText(String.valueOf(controlfolio));
                                    JOptionPane.showMessageDialog(null,"Requisicion Correcta, Gracias", "Sistema Integral(Requisicion Almacen) : Confirmacion",1);
                                     try{
                                    texto="select  * from x1distribucion_terminados_ventas_recepcion_detalle(2,'"+this.tf_foliotienda.getText().toString()+"','"+controlfolio+"','"+""+"','0','"+""+"','"+""+"','0.20','"+""+"') ;";
                                    System.out.println(texto);
                                    rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                                        }
                                    catch(Exception e)
                                        {
                                            System.out.println(e.getMessage());
                                        }
                                }
                            else
                                {
                                                    JOptionPane.showMessageDialog(null," Error Verifique sus Cantidades", "Sistema Integral(requisicion Insumos) : Error",1);
                                }
            x.cierraConexionexterna(variables_global.getconexiongralext());
        }
        }
        else
                              {
                                                    JOptionPane.showMessageDialog(null," Error Docto ya Actualizado", "Sistema Integral(requisicion Articulos) : Error",1);
                                }
}//GEN-LAST:event_jbtn_guardaexternaActionPerformed
private String fechaamericana(Date fe) {
       SimpleDateFormat formateadorestaeuropa = new SimpleDateFormat("yyyy-MM-dd");
       String cadenafecha="";
       cadenafecha= formateadorestaeuropa.format(fe);
       return cadenafecha;

    }

    private void jtf_rfcActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_rfcActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jtf_rfcActionPerformed

    private void jtf_dompoblacionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_dompoblacionActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jtf_dompoblacionActionPerformed

    private void jtf_emailActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_emailActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jtf_emailActionPerformed

    private void tf_foliosigActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tf_foliosigActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_tf_foliosigActionPerformed

    private void jtf_clienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_clienteActionPerformed
        // TODO add your handling code here:
        this.jtf_domcalle1.requestFocus();
}//GEN-LAST:event_jtf_clienteActionPerformed

    private void jtf_observaciones1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_observaciones1ActionPerformed
        // TODO add your handling code here:
     
}//GEN-LAST:event_jtf_observaciones1ActionPerformed

    private void jtf_dompobla1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_dompobla1ActionPerformed
        // TODO add your handling code here:
        this.jtf_email2.requestFocus();
}//GEN-LAST:event_jtf_dompobla1ActionPerformed

    private void jtf_cpActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_cpActionPerformed
        // TODO add your handling code here:
        this.jtf_rfc.requestFocus();
}//GEN-LAST:event_jtf_cpActionPerformed

    private void jtf_domcalle1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_domcalle1ActionPerformed
        // TODO add your handling code here:
        this.jtf_domcolonia1.requestFocus();
}//GEN-LAST:event_jtf_domcalle1ActionPerformed

    private void jtf_domcolonia1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_domcolonia1ActionPerformed
        // TODO add your handling code here:
        this.jtf_dompobla1.requestFocus();
}//GEN-LAST:event_jtf_domcolonia1ActionPerformed

    private void jtf_email2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_email2ActionPerformed
        // TODO add your handling code here:
        this.jtf_cp.requestFocus();
}//GEN-LAST:event_jtf_email2ActionPerformed

    private void jtf_direccion3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_direccion3ActionPerformed
        // TODO add your handling code here:
        this.jtf_atnventas.requestFocus();
}//GEN-LAST:event_jtf_direccion3ActionPerformed

    private void jtf_rfc1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_rfc1ActionPerformed
        // TODO add your handling code here:
        this.jtf_tel.requestFocus();
}//GEN-LAST:event_jtf_rfc1ActionPerformed

    private void jtf_telActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_telActionPerformed
        // TODO add your handling code here:
        this.jtf_direccion2.requestFocus();
}//GEN-LAST:event_jtf_telActionPerformed

    private void jtf_atnventasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_atnventasActionPerformed
        // TODO add your handling code here:
        this.jtf_atncobra.requestFocus();
}//GEN-LAST:event_jtf_atnventasActionPerformed

    private void jtf_atncobraActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_atncobraActionPerformed
        // TODO add your handling code here:
        this.jtf_observaciones1.requestFocus();
}//GEN-LAST:event_jtf_atncobraActionPerformed

    private void jtf_fotosartxpagActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_fotosartxpagActionPerformed
        // TODO add your handling code here:
        this.carga_datos_facturapaginacion(Integer.valueOf(this.jtf_paginaactual.getText().toString()));
}//GEN-LAST:event_jtf_fotosartxpagActionPerformed

    private void jbtn_anteriorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_anteriorActionPerformed
        // TODO add your handling code here:
        this.jtf_paginaactual.setText(String.valueOf(Integer.valueOf(this.jtf_paginaactual.getText().toString())-1));
        System.out.println("Esta es la pagina que mando"+this.jtf_paginaactual.getText());
        this.carga_datos_facturapaginacion(Integer.valueOf(this.jtf_paginaactual.getText().toString()));
    }//GEN-LAST:event_jbtn_anteriorActionPerformed

    private void jtf_paginaactualActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_paginaactualActionPerformed
        // TODO add your handling code here:
        this.carga_datos_facturapaginacion(Integer.valueOf(this.jtf_paginaactual.getText().toString()));
}//GEN-LAST:event_jtf_paginaactualActionPerformed

    private void jbtn_siguienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_siguienteActionPerformed
        // TODO add your handling code here:
        this.jtf_paginaactual.setText(String.valueOf(Integer.valueOf(this.jtf_paginaactual.getText().toString())+1));
        System.out.println("Esta es la pagina que mando"+this.jtf_paginaactual.getText());
        this.carga_datos_facturapaginacion(Integer.valueOf(this.jtf_paginaactual.getText().toString()));

    }//GEN-LAST:event_jbtn_siguienteActionPerformed

    private void btn_imprimir1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_imprimir1ActionPerformed
        // TODO add your handling code here:
                         this.imprimirfactura(0,0);
    }//GEN-LAST:event_btn_imprimir1ActionPerformed

    private void jtf_fpimpuActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_fpimpuActionPerformed
        // TODO add your handling code here:
        this.calcularimportesfactura();
    }//GEN-LAST:event_jtf_fpimpuActionPerformed

    private void jtf_fmargenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_fmargenActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jtf_fmargenActionPerformed

    private void jtf_fotosartxpag1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_fotosartxpag1ActionPerformed
        // TODO add your handling code here:
        this.carga_datos_fotospaginacion(Integer.valueOf(this.jtf_paginaactual.getText().toString()));
}//GEN-LAST:event_jtf_fotosartxpag1ActionPerformed

    private void jbtn_anterior1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_anterior1ActionPerformed
        // TODO add your handling code here:
        this.jtf_paginaactual1.setText(String.valueOf(Integer.valueOf(this.jtf_paginaactual1.getText().toString())-1));
        System.out.println("Esta es la pagina que mando"+this.jtf_paginaactual1.getText());
        this.carga_datos_fotospaginacion(Integer.valueOf(this.jtf_paginaactual1.getText().toString()));
    }//GEN-LAST:event_jbtn_anterior1ActionPerformed

    private void jtf_paginaactual1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_paginaactual1ActionPerformed
        // TODO add your handling code here:
        this.carga_datos_fotospaginacion(Integer.valueOf(this.jtf_paginaactual1.getText().toString()));
}//GEN-LAST:event_jtf_paginaactual1ActionPerformed

    private void jbtn_siguiente1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_siguiente1ActionPerformed
        // TODO add your handling code here:
        this.jtf_paginaactual1.setText(String.valueOf(Integer.valueOf(this.jtf_paginaactual1.getText().toString())+1));
        System.out.println("Esta es la pagina que mando"+this.jtf_paginaactual1.getText());
        this.carga_datos_fotospaginacion(Integer.valueOf(this.jtf_paginaactual1.getText().toString()));
    }//GEN-LAST:event_jbtn_siguiente1ActionPerformed

    private void jbtn_cancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_cancelarActionPerformed
        // TODO add your handling code here:
        if(JOptionPane.showConfirmDialog(null, "<html><body><h2>Desea Cancelar Folio?:<b>"+this.tf_foliotienda.getText()+"<br>Cliente:"+this.tf_cliente.getText()+"</b></h2></body></html>")==0) {
            String razon=JOptionPane.showInputDialog("Ingrese Razon de Cancelacion:","Razon");
            {
                String retorno="";

                try {
                    rs = x.sieuno_executediversosv2("select * from x1distribucion_ventas_cancela('"+this.tf_foliotienda.getText()+"','"+this.jtf_idc.getText()+"',2,'"+razon.trim().toUpperCase()+"');",variables_global.getconexiongral());
                    while (rs.next()) {
                        retorno=rs.getString(1);
                    }
                } catch(Exception e) {
                    System.out.println(e.getMessage());
                }
                if (retorno.equals("1")) {

                    this.jbtn_cancelar.setVisible(false);
                }
            }
        }
    }//GEN-LAST:event_jbtn_cancelarActionPerformed

    private void jbtn_actualizarobser1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_actualizarobser1ActionPerformed
        // TODO add your handling code here:
      String retorno="",texto="";
        if(JOptionPane.showConfirmDialog(null, "Desea Actualizar Familias y Subfamilias?")==0)
        {
            texto="select * from x1distribucion_ventas_add_sieuno_corrije('"+this.tf_foliotienda.getText().toString()+"');";
            System.out.println(texto);
            try
                {
                    rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                    while (rs.next())
                        {
                            retorno=rs.getString(1);
                        }
                }
                catch(Exception e)
                    {
                        System.out.println(e.getMessage());
                    }
                    if (retorno.equals("1"))
                                     {

                                     }
        }
    }//GEN-LAST:event_jbtn_actualizarobser1ActionPerformed

    private void jmni_impresioncostoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_impresioncostoActionPerformed
        // TODO add your handling code here:
        if(variables_global.getnivelusu()<3)
            {
                this.imprimirdifcosto();
            }
    }//GEN-LAST:event_jmni_impresioncostoActionPerformed

    private void jbtn_generarventa2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_generarventa2ActionPerformed
        // TODO add your handling code here:
        if(JOptionPane.showConfirmDialog(null,"<html><h2>Desea Generar Distribucion Para Cliente:<br>"+this.jtf_idcliente1.getText()+":"+this.tf_cliente.getText()+" con<br>Total pieza="+this.jtf_totalpiezas.getText()+"<br>Importe Costo Proveedor:$"+this.jtf_doctototal.getText()+"<br> Importe Costo Integrado:$"+this.jtf_doctototal.getText()+"</html>")==0) {

            int retorno=0;
            String texto="select * from x1distribucion_terminados_ventas_agregar_compracompleta(3,'"+this.tf_foliotienda.getText()+"','1','"+this.jtf_idc.getText()+"','','');";
            System.out.println(texto);
            try {
                rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                while (rs.next()) {
                    retorno=rs.getInt(1);
                }
            } catch(Exception e) {
                System.out.println(e.getMessage());
            }
            if (retorno>0) {
                //this.jbtn_generarventa.setVisible(false);
                //jtable_modelo.setValueAt(retorno,Integer.valueOf(this.jtf_idffila.getText()) ,0);
                JOptionPane.showMessageDialog(null," Folio "+retorno+" Correcto", "Sistema Integral(Venta Alta) : Error",1);
                //this.carga_datos(7,this.tf_foliodistribucion.getText().trim());
            }
            this.jbtn_generarventa2.setVisible(false);
        }
    }//GEN-LAST:event_jbtn_generarventa2ActionPerformed

    private void jMenuItem7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem7ActionPerformed
        // TODO add your handling code here:
            float filas = this.jtable_modelo_detalle.getRowCount() ;
            float paginas = filas /50;
            int ni=0;
            for(ni=0;ni<paginas;ni++)
                {
                    this.imprimir_carta(ni,paginas);
                }
    }//GEN-LAST:event_jMenuItem7ActionPerformed

    private void jcbx_tiendasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcbx_tiendasActionPerformed
        // TODO add your handling code here:
        if (controlcombo > 0 ) {

                String selectin="",ubi[]=null;
                int filastar=this.jt_foliosdetalle.getSelectedRow();
                int filastaf=jt_foliosdetalle.getSelectionModel().getMaxSelectionIndex()+1;
                ubi=this.jcbx_tiendas.getSelectedItem().toString().split(":");
if(JOptionPane.showConfirmDialog(null, "<html><b><h2>Desea Asignar Hubicacion?<br>"+this.tf_cliente.getText()+"<br>Ubicacion"+ubi[1]+"<br>Clave Inicio:"+jtable_modelo_detalle.getValueAt(filastar ,1)+"<br>Clave Final:"+jtable_modelo_detalle.getValueAt(filastaf-1,1)+"</h2></b></html>")==0)
        {


        System.out.println("Fila inicial:"+filastar+"  fila final:"+filastaf);
          int ii=0,confirma=0;

        for( ii=filastar;ii<filastaf;ii++)
                {
                if (ii>0)
                    {
                        selectin+=".";
                    }
                selectin+=""+jtable_modelo_detalle.getValueAt(ii ,1)+"";
                }

    System.out.println(selectin);
  
   String texto="select * from x1sieuno_articulo_inven_ubicacion_update(3,0,'"+selectin+"','"+ubi[0]+"','"+this.jtf_idc.getText()+"','')";
    System.out.println(texto);
    try
         {
            rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
            while (rs.next())
                {
                     confirma=rs.getInt(1);
                }
        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }
       if (confirma==1)
              {
                JOptionPane.showMessageDialog(null,"Gracias datos Actualizados Correctamente", "Sistema Integral Insumos",1);
                //while(jtable_modelo_alm_updatereplace.getRowCount()>0)jtable_modelo_alm_updatereplace.removeRow(0);
                //this.jtf_busqueda.requestFocus();
              }
         else
              {
                JOptionPane.showMessageDialog(null,"Error Consulte con Su Administrador", "Sistema Integral Insumos",1);
              }
        }
            //this.iniciar_modelo_almacenes(arreglo_tiendas[0],arreglo_tiendas[2]);
        }
}//GEN-LAST:event_jcbx_tiendasActionPerformed
    private void jlst_clientesdistribucionMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }
    private  void ayuda()
            {
                String punto1="1.-Detalle de Recepcion de Mercancia, cada opcion se autodescribe brevemente\n";
                String punto2="  2.- Cada Boton tiene Una letra Resaltada el cual indica su metodo abreviado uselo si desea mayor rapides ( ejemplo Alt+a tendra ayuda automaticamente)\n";
                String punto3="  3.- la opcion guardar esta activada para Recepcionar este documento Incluyendo Diferencias si no ingresa diferencias, el sistema guardara el documento como correcto\n";
                JOptionPane.showMessageDialog(null,punto1+punto2+punto3, "Sistema Integral(Detalle Recepcion) : Ayuda",1);
            }

   private void dioclick(java.awt.event.MouseEvent evt)
     {
        // TODO add your handling code here:
            System.out.println("dio doble  click");
            int fila = jt_foliosdetalle.getSelectedRow();
            Object valor = jt_foliosdetalle.getValueAt(fila, 3);
            System.out.println("hola"+String.valueOf(valor));
            //se concatena el item mas JPG PARA MOSTRAR IMAGEN
            //jep_visorimagen.setText("<img src=\"http://"+variables_global.getHost()+"/distribucion/fotos/"+String.valueOf(valor)+".JPG\" width=\"300\" height=\"215\" border=\"0\" alt=\"Foto Articulo\"></img>");
    //setVisible(false);
     }
   private void dioclickfactura(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
        String cliente[]=this.jlst_clientesdistribucion.getSelectedValue().toString().split(":");
       
           this.carga_datos_clientesactualiza(2,cliente[0]);
    }

     private void jt_foliosdetalleKeyPressed(java.awt.event.KeyEvent evt) {
        System.out.println(evt.getKeyCode());
        if ((evt.getKeyCode() == 40) || (evt.getKeyCode() == 38) || (evt.getKeyCode() == 10))
            {
            try
            {
                int fila = jt_foliosdetalle.getSelectedRow();
                Object valor = jt_foliosdetalle.getValueAt(fila, 3);
                 //se concatena el item mas JPG PARA MOSTRAR IMAGEN
              //   jep_visorimagen.setText("<img src=\"http://"+variables_global.getHost()+"/distribucion/fotos/"+String.valueOf(valor)+".JPG\" width=\"300\" height=\"215\" border=\"0\" alt=\"Foto Articulo\"></img>");
            } catch (Exception ex)
                {
                System.out.println("ERROR no ha elegido en el cuadro de texto");
                }
            }
     }

    private void imprimir(int pag,float ptotal)
    {
            this.objimpresora=new com_distri_folios_imprimir();

     this.objimpresora.setOneItem_cadenas_a_imprimir("     Recepcion de Mercancia");
     this.objimpresora.setOneItem_cadenas_a_imprimir("     Fecha:"+this.tf_fecha.getText()+"");
     this.objimpresora.setOneItem_cadenas_a_imprimir("     Folio Distribucion:"+this.tf_foliodistribucion.getText()+"");
     this.objimpresora.setOneItem_cadenas_a_imprimir("     Folio Tienda:"+this.tf_foliotienda.getText()+"");
     this.objimpresora.setOneItem_cadenas_a_imprimir("     Status Documento:"+this.tf_status.getText()+"");
     this.objimpresora.setOneItem_cadenas_a_imprimir("     Cliente o Tienda:"+this.tf_cliente.getText()+"");
     this.objimpresora.setOneItem_cadenas_a_imprimir("     Observaciones:"+this.ta_observaciones.getText()+"");
     this.objimpresora.setOneItem_cadenas_a_imprimir("*");
     this.objimpresora.setOneItem_cadenas_a_imprimir("     Total Piezas:"+this.jtf_totalpiezas.getText()+"");
     this.objimpresora.setOneItem_cadenas_a_imprimir("     paginas:"+ pag + " de "+ptotal+"");
     this.objimpresora.setOneItem_cadenas_a_imprimir("     Responsable Almacen: ______________");
     this.objimpresora.setOneItem_cadenas_a_imprimir("     Empaco: ______________");
     this.objimpresora.setOneItem_cadenas_a_imprimir("     Recibio: ______________");
     this.objimpresora.setOneItem_cadenas_a_imprimir("..");
     this.objimpresora.setOneItem_cadenas_a_imprimir("..");
     this.objimpresora.setOneItem_cadenas_a_imprimir("..");
     this.objimpresora.setOneItem_cadenas_a_imprimir("..");
     this.objimpresora.setOneItem_cadenas_a_imprimir("..");
     this.objimpresora.setOneItem_cadenas_a_imprimir("..");
     this.objimpresora.setOneItem_cadenas_a_imprimir("..");
     this.objimpresora.setOneItem_cadenas_a_imprimir("*");
     this.objimpresora.setObjeto_tabla(jt_foliosdetalle);
     this.objimpresora.imprimir_all(1,pag);
    }
     private void imprimirdif()
    {
     this.objimpresora=new com_distri_folios_imprimir();

     this.objimpresora.setOneItem_cadenas_a_imprimir("Recepcion:Reporte de Diferencias");
     this.objimpresora.setOneItem_cadenas_a_imprimir("Fecha:"+this.tf_fecha.getText()+"");
     this.objimpresora.setOneItem_cadenas_a_imprimir("Folio Distribucion:"+this.tf_foliodistribucion.getText()+"");
     this.objimpresora.setOneItem_cadenas_a_imprimir("Folio Tienda:"+this.tf_foliotienda.getText()+"");
     this.objimpresora.setOneItem_cadenas_a_imprimir("Status Documento:"+this.tf_status.getText()+"");
     this.objimpresora.setOneItem_cadenas_a_imprimir("Tienda:"+this.tf_cliente.getText()+"");
     this.objimpresora.setOneItem_cadenas_a_imprimir("Observaciones:"+this.ta_observaciones.getText()+"");
     this.objimpresora.setOneItem_cadenas_a_imprimir("*");
     this.objimpresora.setOneItem_cadenas_a_imprimir("Total Piezas:"+this.jtf_totalpiezas.getText()+"");
     this.objimpresora.setOneItem_cadenas_a_imprimir("Responsalbe Almacen: ______________");
     this.objimpresora.setOneItem_cadenas_a_imprimir("Empaco: ______________");
     this.objimpresora.setOneItem_cadenas_a_imprimir("Recibio: ______________");
     this.objimpresora.setOneItem_cadenas_a_imprimir("*");
     this.objimpresora.setObjeto_tabla(jt_foliosdetalle);
     this.objimpresora.imprimir_all(2,1);
    }

  private void imprimirdifcosto()
    {
     this.objimpresora=new com_distri_folios_imprimir();
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Id-Rep:VD-01                            S.I.: Reporte de Diferencias en Tiendas");
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Fecha de Reporte:"+this.fechaeuropea(fechahoy)+"  Hora"+fechahoy.getHours()+":"+fechahoy.getMinutes()+ "   Usuario:"+variables_global.getNombre());
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Fecha:"+this.tf_fecha.getText()+"");
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Folio Distribucion:"+this.tf_foliodistribucion.getText()+"");
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Folio Tienda:"+this.tf_foliotienda.getText()+"");
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Status Documento:"+this.tf_status.getText()+"");
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Tienda:"+this.tf_cliente.getText()+"");
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Observaciones:"+this.ta_observaciones.getText()+"");
     this.objimpresora.setOneItem_cadenas_a_imprimir("*");
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Total Piezas:"+this.jtf_totalpiezas.getText()+" Importe Documento:"+this.jtf_doctototal.getText());
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Pz Dif:"+this.jtf_totalpiezas1.getText()+" Importe Diferencia:"+this.jtf_doctototal1.getText());
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Responsalbe Almacen: ______________");
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Empaco: ______________");
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Recibio: ______________");
     this.objimpresora.setOneItem_cadenas_a_imprimir("*");
     this.objimpresora.setObjeto_tabla(jt_foliosdetalle);
     this.objimpresora.imprimir_all(23,1);
    }

    private void imprimirfactura(int pag,float ptotal)
    {
            this.objimpresora=new com_distri_folios_imprimir();
            int margen=Integer.valueOf(this.jtf_fmargen.getText().toString());

     this.objimpresora.setOneItem_cadenas_a_imprimir("                                    ");
     this.objimpresora.setOneItem_cadenas_a_imprimir("                                    ");
     this.objimpresora.setOneItem_cadenas_a_imprimir("                                    ");
      for(int i = 0 ;i < margen; i++)
                {
                this.objimpresora.setOneItem_cadenas_a_imprimir("                                    ");
                }
    this.objimpresora.setOneItem_cadenas_a_imprimir("                                                                                                                                                                                           "+this.jtf_ffecha.getText());
    this.objimpresora.setOneItem_cadenas_a_imprimir("                                    ");
    this.objimpresora.setOneItem_cadenas_a_imprimir("                                "+this.jtf_observaciones1.getText());
    this.objimpresora.setOneItem_cadenas_a_imprimir("                                    ");
    this.objimpresora.setOneItem_cadenas_a_imprimir("                                "+this.jtf_domcalle1.getText());
    this.objimpresora.setOneItem_cadenas_a_imprimir("                                    ");
    this.objimpresora.setOneItem_cadenas_a_imprimir("                                "+this.jtf_domcolonia1.getText()+" "+jtf_dompobla1.getText()+"                        "+this.jtf_rfc1.getText());
    this.objimpresora.setOneItem_cadenas_a_imprimir("                                    ");
    this.objimpresora.setOneItem_cadenas_a_imprimir("                                VENTA A CREDITO                                                                                                            "+this.jtf_cp.getText());
    this.objimpresora.setOneItem_cadenas_a_imprimir("*");
    this.objimpresora.setOneItem_cadenas_a_imprimir("                                   ");
    this.objimpresora.setOneItem_cadenas_a_imprimir("                                    ");
     this.objimpresora.setOneItem_cadenas_a_imprimir("                                    ");
    this.objimpresora.setOneItem_cadenas_a_imprimir("                                      "+this.jtf_importepesos.getText()+"");
    this.objimpresora.setOneItem_cadenas_a_imprimir("                                    ");
    this.objimpresora.setOneItem_cadenas_a_imprimir("                                                                                                                                                                                             "+this.jtf_fsubtotal.getText()+"");
    this.objimpresora.setOneItem_cadenas_a_imprimir("                                    ");
    this.objimpresora.setOneItem_cadenas_a_imprimir("                                                                                                                                                                                             "+this.jtf_fImpuesto.getText()+"");
    this.objimpresora.setOneItem_cadenas_a_imprimir("                                    ");
    this.objimpresora.setOneItem_cadenas_a_imprimir("                                                                                                                                                                                             "+this.jtf_ftotal.getText()+"");
    this.objimpresora.setOneItem_cadenas_a_imprimir("*");
    this.objimpresora.setObjeto_tabla(jt_formatofactura1);
    this.objimpresora.imprimir_all(11,pag);
    }

     private void imprimir_carta(int pag,float ptotal)
    {
            this.objimpresora=new com_distri_folios_imprimir();

     this.objimpresora.setOneItem_cadenas_a_imprimir("     Recepcion de Mercancia");
     this.objimpresora.setOneItem_cadenas_a_imprimir("     Fecha:"+this.tf_fecha.getText()+"");
     this.objimpresora.setOneItem_cadenas_a_imprimir("     Folio Distribucion:"+this.tf_foliodistribucion.getText()+"");
     this.objimpresora.setOneItem_cadenas_a_imprimir("     Folio Tienda:"+this.tf_foliotienda.getText()+"");
     this.objimpresora.setOneItem_cadenas_a_imprimir("     Status Documento:"+this.tf_status.getText()+"");
     this.objimpresora.setOneItem_cadenas_a_imprimir("     Cliente o Tienda:"+this.tf_cliente.getText()+"");
     this.objimpresora.setOneItem_cadenas_a_imprimir("     Observaciones:"+this.ta_observaciones.getText()+"");
     this.objimpresora.setOneItem_cadenas_a_imprimir("*");
     this.objimpresora.setOneItem_cadenas_a_imprimir("     Total Piezas:"+this.jtf_totalpiezas.getText()+"");
     this.objimpresora.setOneItem_cadenas_a_imprimir("     paginas:"+ pag + " de "+ptotal+"");
     this.objimpresora.setOneItem_cadenas_a_imprimir("     Responsable Almacen: ______________");
     this.objimpresora.setOneItem_cadenas_a_imprimir("     Empaco: ______________");
     this.objimpresora.setOneItem_cadenas_a_imprimir("     Recibio: ______________");
     this.objimpresora.setOneItem_cadenas_a_imprimir("..");
     this.objimpresora.setOneItem_cadenas_a_imprimir("..");
     this.objimpresora.setOneItem_cadenas_a_imprimir("..");
     this.objimpresora.setOneItem_cadenas_a_imprimir("..");
     this.objimpresora.setOneItem_cadenas_a_imprimir("..");
     this.objimpresora.setOneItem_cadenas_a_imprimir("..");
     this.objimpresora.setOneItem_cadenas_a_imprimir("..");
     this.objimpresora.setOneItem_cadenas_a_imprimir("*");
     this.objimpresora.setObjeto_tabla(jt_foliosdetalle);
     this.objimpresora.imprimir_all(26,pag);
    }

    private void crearcomentario()
          {
                 String retorno="";

        String comentario=JOptionPane.showInputDialog("Ingresa Tu Sugerencia o Comentario:");
        if (comentario.length()>0)
        {
            rs = x.sieuno_executediversosv2("select * from x1distribucion_bitacorainserta('"+comentario+"', 'Recepcion Detalle');",variables_global.getconexiongral());
            try
            {

               while (rs.next())
                    {
                         retorno=rs.getString(1);
                   }
             }
            catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
            if (retorno.equals("1"))
              {
                JOptionPane.showMessageDialog(null,"Gracias Tu comentario ha sido guardado", "Sistema Integral Comentarios",1);

              }

      }
    }
private void carga_datos_clientesactualiza(int opcion,String textobusca)
    {
       String texto="select * from x1distribucion_terminados_ventas_clientes_catalogo("+opcion+",'"+textobusca+"','') as (id character varying(12),nombre character varying(60),direccion character varying(50),colonia character varying(50),poblacion character varying(40),cpcliente character varying(6),rfc character varying(15),curp character varying(20),telefono character varying(80),fax character varying(15),email character varying(80),clasif smallint,diascre smallint,limite numeric,descliente numeric,fechaultv date,fechaultp date,obser character varying(80),idstatus smallint,direccion2 character varying(80),statusdes character varying(40),descripcla character varying(40),atnven character varying(60),atncob character varying(60),acumcli numeric,idreg integer);";
       System.out.println(texto);
       try
       {
            rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
            while (rs.next())
                {
                       this.jtf_idcliente1.setText(rs.getString("id"));
                       this.jtf_cliente.setText(rs.getString("nombre"));
                       this.jtf_domcalle1.setText(rs.getString("direccion"));
                       this.jtf_domcolonia1.setText(rs.getString("colonia"));
                       this.jtf_dompobla1.setText(rs.getString("poblacion"));
                       this.jtf_email2.setText(rs.getString("email"));
                       this.jtf_cp.setText(rs.getString("cpcliente"));
                       this.jtf_rfc1.setText(rs.getString("rfc"));
                       this.jtf_tel.setText(rs.getString("telefono"));
                       this.jtf_direccion2.setText(rs.getString("direccion2"));
                       this.jtf_atnventas.setText(rs.getString("atnven"));
                       this.jtf_atncobra.setText(rs.getString("atncob"));
                       this.jtf_observaciones1.setText(rs.getString("obser"));
                }
        }
        catch(Exception e)
            {
            System.out.println(e.getMessage());
            }
   }

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
             new com_distri_folios_detalle().setVisible(true);
            }
        });
    }

    

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btn_guardar;
    private javax.swing.JButton btn_imprimir;
    private javax.swing.JButton btn_imprimir1;
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel31;
    private javax.swing.JLabel jLabel32;
    private javax.swing.JLabel jLabel33;
    private javax.swing.JLabel jLabel34;
    private javax.swing.JLabel jLabel35;
    private javax.swing.JLabel jLabel36;
    private javax.swing.JLabel jLabel37;
    private javax.swing.JLabel jLabel38;
    private javax.swing.JLabel jLabel39;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel40;
    private javax.swing.JLabel jLabel41;
    private javax.swing.JLabel jLabel42;
    private javax.swing.JLabel jLabel43;
    private javax.swing.JLabel jLabel44;
    private javax.swing.JLabel jLabel45;
    private javax.swing.JLabel jLabel46;
    private javax.swing.JLabel jLabel47;
    private javax.swing.JLabel jLabel48;
    private javax.swing.JLabel jLabel49;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel50;
    private javax.swing.JLabel jLabel51;
    private javax.swing.JLabel jLabel52;
    private javax.swing.JLabel jLabel53;
    private javax.swing.JLabel jLabel54;
    private javax.swing.JLabel jLabel55;
    private javax.swing.JLabel jLabel56;
    private javax.swing.JLabel jLabel57;
    private javax.swing.JLabel jLabel58;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenu jMenu3;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuItem jMenuItem3;
    private javax.swing.JMenuItem jMenuItem4;
    private javax.swing.JMenuItem jMenuItem5;
    private javax.swing.JMenuItem jMenuItem6;
    private javax.swing.JMenuItem jMenuItem7;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel11;
    private javax.swing.JPanel jPanel12;
    private javax.swing.JPanel jPanel13;
    private javax.swing.JPanel jPanel14;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane10;
    private javax.swing.JScrollPane jScrollPane11;
    private javax.swing.JScrollPane jScrollPane12;
    private javax.swing.JScrollPane jScrollPane13;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JScrollPane jScrollPane7;
    private javax.swing.JScrollPane jScrollPane8;
    private javax.swing.JScrollPane jScrollPane9;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JButton jbtn_actualizarobser;
    private javax.swing.JButton jbtn_actualizarobser1;
    private javax.swing.JButton jbtn_anterior;
    private javax.swing.JButton jbtn_anterior1;
    private javax.swing.JButton jbtn_cancelar;
    private javax.swing.JButton jbtn_fechallegatienda;
    private javax.swing.JButton jbtn_generarventa2;
    private javax.swing.JButton jbtn_guardaexterna;
    private javax.swing.JButton jbtn_helpayudame;
    private javax.swing.JButton jbtn_imprimirpedido;
    private javax.swing.JButton jbtn_salir;
    private javax.swing.JButton jbtn_siguiente;
    private javax.swing.JButton jbtn_siguiente1;
    private javax.swing.JCheckBox jcb_verfotos1;
    private javax.swing.JCheckBox jcb_verfotos2;
    private javax.swing.JComboBox jcbx_tiendas;
    private javax.swing.JEditorPane jep_facturaexport;
    private javax.swing.JEditorPane jepn_fotos;
    private javax.swing.JLabel jlbl_paginas;
    private javax.swing.JLabel jlbl_paginas1;
    private javax.swing.JLabel jlbl_paginas2;
    private javax.swing.JList jlst_clientesdistribucion;
    private javax.swing.JMenuItem jmni_creasugerencia;
    private javax.swing.JMenuItem jmni_guardarf7;
    private javax.swing.JMenuItem jmni_impresioncosto;
    private javax.swing.JMenuItem jmni_irabusqueda;
    private javax.swing.JMenuItem jmni_salir;
    private javax.swing.JTable jt_faltantes;
    private javax.swing.JTable jt_foliosdetalle;
    private javax.swing.JTable jt_foliosdetalle1;
    private javax.swing.JTable jt_formatofactura;
    private javax.swing.JTable jt_formatofactura1;
    private javax.swing.JTable jt_formatofactura2;
    private javax.swing.JTable jt_sobrantes;
    private javax.swing.JTextArea jta_guiadocto;
    private javax.swing.JTable jtb_almacensurtirexterno;
    private javax.swing.JTextField jtf_atncobra;
    private javax.swing.JTextField jtf_atnventas;
    private javax.swing.JTextField jtf_cliente;
    private javax.swing.JTextField jtf_clieteexterno;
    private javax.swing.JTextField jtf_cp;
    private javax.swing.JTextField jtf_descuento;
    private javax.swing.JTextField jtf_direccion2;
    private javax.swing.JTextField jtf_direccion3;
    private javax.swing.JTextField jtf_doctodesc;
    private javax.swing.JTextField jtf_doctoimp;
    private javax.swing.JTextField jtf_doctosubtotal;
    private javax.swing.JTextField jtf_doctototal;
    private javax.swing.JTextField jtf_doctototal1;
    private javax.swing.JTextField jtf_domcalle;
    private javax.swing.JTextField jtf_domcalle1;
    private javax.swing.JTextField jtf_domcod;
    private javax.swing.JTextField jtf_domcolonia;
    private javax.swing.JTextField jtf_domcolonia1;
    private javax.swing.JTextField jtf_dompobla1;
    private javax.swing.JTextField jtf_dompoblacion;
    private javax.swing.JTextField jtf_email;
    private javax.swing.JTextField jtf_email2;
    private javax.swing.JTextField jtf_etiquetasfallidas;
    private javax.swing.JTextField jtf_etiquetasfaltante;
    private javax.swing.JTextField jtf_fImpuesto;
    private javax.swing.JTextField jtf_fdesc;
    private javax.swing.JTextField jtf_fdescuento;
    private javax.swing.JTextField jtf_fecharecepcion;
    private javax.swing.JTextField jtf_fecharecibidotienda;
    private javax.swing.JTextField jtf_ffecha;
    private javax.swing.JTextField jtf_fmargen;
    private javax.swing.JTextField jtf_fotosartxpag;
    private javax.swing.JTextField jtf_fotosartxpag1;
    private javax.swing.JTextField jtf_fpimpu;
    private javax.swing.JTextField jtf_fsubtotal;
    private javax.swing.JTextField jtf_ftotal;
    private javax.swing.JTextField jtf_idc;
    private javax.swing.JTextField jtf_idcliente1;
    private javax.swing.JTextField jtf_idclienteexterno;
    private javax.swing.JTextField jtf_importefal;
    private javax.swing.JTextField jtf_importepesos;
    private javax.swing.JTextField jtf_importesob;
    private javax.swing.JTextField jtf_impuesto;
    private javax.swing.JTextField jtf_observ_update;
    private javax.swing.JTextField jtf_observaciones1;
    private javax.swing.JTextField jtf_operofalfol;
    private javax.swing.JTextField jtf_operorecepcion;
    private javax.swing.JTextField jtf_operorechora;
    private javax.swing.JTextField jtf_operosobfol;
    private javax.swing.JTextField jtf_paginaactual;
    private javax.swing.JTextField jtf_paginaactual1;
    private javax.swing.JTextField jtf_rfc;
    private javax.swing.JTextField jtf_rfc1;
    private javax.swing.JTextField jtf_tel;
    private javax.swing.JTextField jtf_telefono;
    private javax.swing.JTextField jtf_totalpiezas;
    private javax.swing.JTextField jtf_totalpiezas1;
    private javax.swing.JTextArea ta_observaciones;
    private javax.swing.JTextField tf_cliente;
    private javax.swing.JTextField tf_fecha;
    private javax.swing.JTextField tf_foliodistribucion;
    private javax.swing.JTextField tf_foliosig;
    private javax.swing.JTextField tf_foliotienda;
    private javax.swing.JTextField tf_status;
    // End of variables declaration//GEN-END:variables
    private com_distri_folios_imprimir objimpresora;
}
